Skip to content

Commit

Permalink
fix: #25 - Where max line width calculation was incorrect in certain …
Browse files Browse the repository at this point in the history
…scenarios.
  • Loading branch information
dsherret committed Jul 12, 2020
1 parent 6ee9a1e commit 04dfcf4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "dprint-plugin-typescript"
description = "TypeScript code formatting plugin for Dprint."
keywords = ["formatting", "formatter", "typescript"]
version = "0.19.8"
version = "0.19.9"
authors = ["David Sherret <[email protected]>"]
edition = "2018"
license = "MIT"
Expand All @@ -21,7 +21,7 @@ overflow-checks = false
panic = "abort"

[dependencies]
dprint-core = "0.24.0"
dprint-core = "0.24.1"
swc_common = "=0.6.2"
swc_ecma_ast = "=0.23.1"
swc_ecma_parser = "=0.27.0"
Expand Down
1 change: 0 additions & 1 deletion src/parsing/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,6 @@ fn parse_binary_expr<'a>(node: &'a BinExpr, context: &mut Context<'a>) -> PrintI
force_possible_newline_at_start: false,
}).items);


return if node.op.is_equality() { parser_helpers::new_line_group(items) } else { items };

fn get_allow_no_indent(node: &BinExpr, context: &mut Context) -> bool {
Expand Down
14 changes: 14 additions & 0 deletions tests/specs/issues/issue0025.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
~~ deno: true ~~
== should format as-is (previously it would move to next line) ==
export function test(): boolean {
return (
typeof ttttttttttttttttttttvalue !== "object" && typeof value !== "function"
);
}

[expect]
export function test(): boolean {
return (
typeof ttttttttttttttttttttvalue !== "object" && typeof value !== "function"
);
}

0 comments on commit 04dfcf4

Please sign in to comment.