-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable import attributes parsing by default (#16850)
* Enable import attributes parsing by default * Remove plugin from tests * Update fixtures * Fix failures * `make build` * Fix TS errors * Fix * Update .d.ts * Move in core * [babel 8] Remove syntax plugins from preset-env * Update fixtures * Fix ESM build of Babel 7 and standalone * Update flow allowlist * Update parser fixtures for Babel 8 * Update generator tests * Update parser test * Update standalone * Do not run import attribtues plugin test in Babel 8 * Make tests pass in babel 8 * Fix Babel 8 build * [babel 8] Stop printing legacy "with" attributes * fix prettier integration test * Fix Babel 8 compat in syntax-import-attributes * Try fix * Do not error for the removed `importAttributes` plugin * Skip a test in babel7/8 compat e2e * Throw an error when using removed option from the parser * Fixes after rebase * Raise `ImportCallArity` also when `createImportExpressions` * Fix linting
- Loading branch information
1 parent
c369676
commit 64fa466
Showing
309 changed files
with
1,271 additions
and
624 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
2 changes: 1 addition & 1 deletion
2
...-generator/test/fixtures/importAttributesKeyword/attributes-assert-to-assert/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"plugins": [["importAttributes", { "deprecatedAssertSyntax": true }]], | ||
"plugins": ["deprecatedImportAssert"], | ||
"importAttributesKeyword": "assert" | ||
} |
4 changes: 1 addition & 3 deletions
4
...generator/test/fixtures/importAttributesKeyword/attributes-assert-to-default/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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
{ | ||
"BABEL_8_BREAKING": true, | ||
"plugins": [["importAttributes", { "deprecatedAssertSyntax": true }]], | ||
"warns": "You are using import attributes, without specifying the desired output syntax.", | ||
"expectedReParseError": true | ||
"plugins": ["deprecatedImportAssert"] | ||
} |
2 changes: 1 addition & 1 deletion
2
...el-generator/test/fixtures/importAttributesKeyword/attributes-assert-to-default/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 |
---|---|---|
@@ -1 +1 @@ | ||
import "a" with type: "json"; | ||
import "a" with { type: "json" }; |
3 changes: 2 additions & 1 deletion
3
...rator/test/fixtures/importAttributesKeyword/attributes-assert-to-with-legacy/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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"plugins": [["importAttributes", { "deprecatedAssertSyntax": true }]], | ||
"BABEL_8_BREAKING": false, | ||
"plugins": ["deprecatedImportAssert"], | ||
"importAttributesKeyword": "with-legacy", | ||
"expectedReParseError": true | ||
} |
2 changes: 1 addition & 1 deletion
2
...el-generator/test/fixtures/importAttributesKeyword/attributes-assert-to-with/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"plugins": [["importAttributes", { "deprecatedAssertSyntax": true }]], | ||
"plugins": ["deprecatedImportAssert"], | ||
"importAttributesKeyword": "with" | ||
} |
1 change: 1 addition & 0 deletions
1
...nerator/test/fixtures/importAttributesKeyword/attributes-with-to-default-babel-7/input.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 @@ | ||
import "a" with { type: "json" }; |
8 changes: 8 additions & 0 deletions
8
...tor/test/fixtures/importAttributesKeyword/attributes-with-to-default-babel-7/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,8 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"_": "The warning is only shown once in the release build, tested by the assertions-with-to-default fixture", | ||
"noWarnInPublishBuild": true, | ||
"plugins": ["importAttributes"], | ||
"warns": "You are using import attributes, without specifying the desired output syntax.", | ||
"expectedReParseError": true | ||
} |
1 change: 1 addition & 0 deletions
1
...erator/test/fixtures/importAttributesKeyword/attributes-with-to-default-babel-7/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 @@ | ||
import "a" with type: "json"; |
7 changes: 2 additions & 5 deletions
7
...l-generator/test/fixtures/importAttributesKeyword/attributes-with-to-default/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 |
---|---|---|
@@ -1,7 +1,4 @@ | ||
{ | ||
"_": "The warning is only shown once in the release build, tested by the assertions-with-to-default fixture", | ||
"noWarnInPublishBuild": true, | ||
"plugins": ["importAttributes"], | ||
"warns": "You are using import attributes, without specifying the desired output syntax.", | ||
"expectedReParseError": true | ||
"BABEL_8_BREAKING": true, | ||
"plugins": ["importAttributes"] | ||
} |
2 changes: 1 addition & 1 deletion
2
...abel-generator/test/fixtures/importAttributesKeyword/attributes-with-to-default/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 |
---|---|---|
@@ -1 +1 @@ | ||
import "a" with type: "json"; | ||
import "a" with { type: "json" }; |
1 change: 1 addition & 0 deletions
1
...nerator/test/fixtures/importAttributesKeyword/attributes-with-to-with-legacy/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
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
Oops, something went wrong.