Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle
.mts
and .cts
files in @babel/preset-typescript
- Loading branch information
1 parent
7b1127c
commit c5e8c75
Showing
28 changed files
with
108 additions
and
32 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
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
packages/babel-preset-typescript/test/fixtures/node-extensions/import-in-cts/input.cts
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 @@ | ||
import "x"; |
3 changes: 3 additions & 0 deletions
3
packages/babel-preset-typescript/test/fixtures/node-extensions/import-in-cts/options.json
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,3 @@ | ||
{ | ||
"throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-typescript/test/fixtures/node-extensions/import-in-mts/input.mts
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 @@ | ||
import "x"; |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-typescript/test/fixtures/node-extensions/import-in-mts/output.mjs
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 @@ | ||
import "x"; |
4 changes: 4 additions & 0 deletions
4
packages/babel-preset-typescript/test/fixtures/node-extensions/options.json
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,4 @@ | ||
{ | ||
"DO_NOT_SET_SOURCE_TYPE": true, | ||
"presets": ["typescript"] | ||
} |
1 change: 1 addition & 0 deletions
1
...ges/babel-preset-typescript/test/fixtures/node-extensions/type-assertion-in-cts/input.cts
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 @@ | ||
<T> x; |
3 changes: 3 additions & 0 deletions
3
.../babel-preset-typescript/test/fixtures/node-extensions/type-assertion-in-cts/options.json
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,3 @@ | ||
{ | ||
"throws": "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. (1:0)" | ||
} |
1 change: 1 addition & 0 deletions
1
...ges/babel-preset-typescript/test/fixtures/node-extensions/type-assertion-in-mts/input.mts
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 @@ | ||
<T> x; |
3 changes: 3 additions & 0 deletions
3
.../babel-preset-typescript/test/fixtures/node-extensions/type-assertion-in-mts/options.json
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,3 @@ | ||
{ | ||
"throws": "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. (1:0)" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-typescript/test/fixtures/node-extensions/type-assertion-in-ts/input.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 @@ | ||
<T> x; |
3 changes: 3 additions & 0 deletions
3
...s/babel-preset-typescript/test/fixtures/node-extensions/type-assertion-in-ts/options.json
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,3 @@ | ||
{ | ||
"DO_NOT_SET_SOURCE_TYPE": false | ||
} |
1 change: 1 addition & 0 deletions
1
...ages/babel-preset-typescript/test/fixtures/node-extensions/type-assertion-in-ts/output.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 @@ | ||
x; |
1 change: 1 addition & 0 deletions
1
...s/babel-preset-typescript/test/fixtures/node-extensions/type-param-arrow-in-cts/input.mts
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 @@ | ||
<T>() => 0; |
3 changes: 3 additions & 0 deletions
3
...abel-preset-typescript/test/fixtures/node-extensions/type-param-arrow-in-cts/options.json
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,3 @@ | ||
{ | ||
"throws": "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`. (1:0)" | ||
} |
1 change: 1 addition & 0 deletions
1
...s/babel-preset-typescript/test/fixtures/node-extensions/type-param-arrow-in-mts/input.mts
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 @@ | ||
<T>() => 0; |
3 changes: 3 additions & 0 deletions
3
...abel-preset-typescript/test/fixtures/node-extensions/type-param-arrow-in-mts/options.json
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,3 @@ | ||
{ | ||
"throws": "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`. (1:0)" | ||
} |
1 change: 1 addition & 0 deletions
1
...ges/babel-preset-typescript/test/fixtures/node-extensions/type-param-arrow-in-ts/input.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 @@ | ||
<T>() => 0; |
3 changes: 3 additions & 0 deletions
3
...babel-preset-typescript/test/fixtures/node-extensions/type-param-arrow-in-ts/options.json
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,3 @@ | ||
{ | ||
"DO_NOT_SET_SOURCE_TYPE": false | ||
} |
1 change: 1 addition & 0 deletions
1
...es/babel-preset-typescript/test/fixtures/node-extensions/type-param-arrow-in-ts/output.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 @@ | ||
() => 0; |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-typescript/test/fixtures/node-extensions/with-in-cts/input.cts
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 @@ | ||
with (x) {} |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-typescript/test/fixtures/node-extensions/with-in-cts/output.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 @@ | ||
with (x) {} |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-typescript/test/fixtures/node-extensions/with-in-mts/input.mts
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 @@ | ||
with (x) {} |
3 changes: 3 additions & 0 deletions
3
packages/babel-preset-typescript/test/fixtures/node-extensions/with-in-mts/options.json
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,3 @@ | ||
{ | ||
"throws": "'with' in strict mode. (1:0)" | ||
} |
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