-
-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(biome_js_parser): support ts resolution-mode import (#3462)
- Loading branch information
1 parent
2a05cd4
commit 30a016b
Showing
19 changed files
with
964 additions
and
155 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
5 changes: 5 additions & 0 deletions
5
crates/biome_js_formatter/tests/specs/ts/type/import_type_with_resolution_mode.ts
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,5 @@ | ||
export type Fs = typeof import('fs', { with: { 'resolution-mode': 'import' } }); | ||
export type TypeFromRequire = | ||
import("pkg", { with: { "resolution-mode": "require" } }).TypeFromRequire; | ||
export type TypeFromImport = | ||
import("pkg", { with: { "resolution-mode": "import" } }).TypeFromImport; |
46 changes: 46 additions & 0 deletions
46
crates/biome_js_formatter/tests/specs/ts/type/import_type_with_resolution_mode.ts.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,46 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: ts/type/import_type_with_resolution_mode.ts | ||
--- | ||
# Input | ||
|
||
```ts | ||
export type Fs = typeof import('fs', { with: { 'resolution-mode': 'import' } }); | ||
export type TypeFromRequire = | ||
import("pkg", { with: { "resolution-mode": "require" } }).TypeFromRequire; | ||
export type TypeFromImport = | ||
import("pkg", { with: { "resolution-mode": "import" } }).TypeFromImport; | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# 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 commas: All | ||
Semicolons: Always | ||
Arrow parentheses: Always | ||
Bracket spacing: true | ||
Bracket same line: false | ||
Attribute Position: Auto | ||
----- | ||
|
||
```ts | ||
export type Fs = typeof import("fs", { with: { "resolution-mode": "import" } }); | ||
export type TypeFromRequire = import("pkg", { | ||
with: { "resolution-mode": "require" }, | ||
}).TypeFromRequire; | ||
export type TypeFromImport = import("pkg", { | ||
with: { "resolution-mode": "import" }, | ||
}).TypeFromImport; | ||
``` |
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
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
1 change: 1 addition & 0 deletions
1
crates/biome_js_parser/test_data/inline/err/import_invalid_args.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import() | ||
import(...["foo"]) | ||
import("foo", { assert: { type: 'json' } }, "bar") | ||
import("foo", { with: { type: 'json' } }, "bar") |
Oops, something went wrong.