-
-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(formatter): correctly handle comments at end of export/import list (
- Loading branch information
1 parent
efa2911
commit d853402
Showing
5 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
crates/biome_js_formatter/tests/specs/js/module/comments/import_exports.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export { | ||
THING, | ||
HERE, | ||
MULTI, | ||
LINE | ||
// comment here should not get moved | ||
} from 'foo'; | ||
|
||
import { | ||
THING, | ||
HERE, | ||
MULTI, | ||
LINE | ||
// comment here should not get moved | ||
} from 'foo'; |
66 changes: 66 additions & 0 deletions
66
crates/biome_js_formatter/tests/specs/js/module/comments/import_exports.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: js/module/comments/import_exports.js | ||
--- | ||
|
||
# Input | ||
|
||
```js | ||
export { | ||
THING, | ||
HERE, | ||
MULTI, | ||
LINE | ||
// comment here should not get moved | ||
} from 'foo'; | ||
|
||
import { | ||
THING, | ||
HERE, | ||
MULTI, | ||
LINE | ||
// comment here should not get moved | ||
} from 'foo'; | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Quote style: Double Quotes | ||
JSX quote style: Double Quotes | ||
Quote properties: As needed | ||
Trailing comma: All | ||
Semicolons: Always | ||
Arrow parentheses: Always | ||
Bracket spacing: true | ||
Bracket same line: false | ||
----- | ||
|
||
```js | ||
export { | ||
THING, | ||
HERE, | ||
MULTI, | ||
LINE, | ||
// comment here should not get moved | ||
} from "foo"; | ||
|
||
import { | ||
THING, | ||
HERE, | ||
MULTI, | ||
LINE, | ||
// comment here should not get moved | ||
} from "foo"; | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters