Skip to content

Commit 04dfcf4

Browse files
committed
fix: #25 - Where max line width calculation was incorrect in certain scenarios.
1 parent 6ee9a1e commit 04dfcf4

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "dprint-plugin-typescript"
33
description = "TypeScript code formatting plugin for Dprint."
44
keywords = ["formatting", "formatter", "typescript"]
5-
version = "0.19.8"
5+
version = "0.19.9"
66
authors = ["David Sherret <[email protected]>"]
77
edition = "2018"
88
license = "MIT"
@@ -21,7 +21,7 @@ overflow-checks = false
2121
panic = "abort"
2222

2323
[dependencies]
24-
dprint-core = "0.24.0"
24+
dprint-core = "0.24.1"
2525
swc_common = "=0.6.2"
2626
swc_ecma_ast = "=0.23.1"
2727
swc_ecma_parser = "=0.27.0"

src/parsing/parser.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,6 @@ fn parse_binary_expr<'a>(node: &'a BinExpr, context: &mut Context<'a>) -> PrintI
14851485
force_possible_newline_at_start: false,
14861486
}).items);
14871487

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

14911490
fn get_allow_no_indent(node: &BinExpr, context: &mut Context) -> bool {

tests/specs/issues/issue0025.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
~~ deno: true ~~
2+
== should format as-is (previously it would move to next line) ==
3+
export function test(): boolean {
4+
return (
5+
typeof ttttttttttttttttttttvalue !== "object" && typeof value !== "function"
6+
);
7+
}
8+
9+
[expect]
10+
export function test(): boolean {
11+
return (
12+
typeof ttttttttttttttttttttvalue !== "object" && typeof value !== "function"
13+
);
14+
}

0 commit comments

Comments
 (0)