[Babel 8]: remove module attributes parser/generator support (#13308)
* breaking: remove support of moduleAttributes * Update packages/babel-parser/src/plugin-utils.js Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com> * chore: remove todo comments * make prettier happy Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'moduleAttributes' (1:27)"
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'moduleAttributes' (1:27)",
|
||||
"BABEL_8_BREAKING": false
|
||||
}
|
||||
|
||||
3
packages/babel-parser/test/fixtures/experimental/module-attributes/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/experimental/module-attributes/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"BABEL_8_BREAKING": false
|
||||
}
|
||||
@@ -65,4 +65,13 @@ describe("plugin options", function () {
|
||||
expect(getParser(SYNTAX_2, [OPT_1, OPT_2])).toThrow();
|
||||
});
|
||||
});
|
||||
describe("'moduleAttributes' plugin", () => {
|
||||
(process.env.BABEL_8_BREAKING ? it : it.skip)("removed in Babel 8", () => {
|
||||
expect(
|
||||
getParser("", ["moduleAttributes"]),
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"\`moduleAttributes\` has been removed in Babel 8, please use \`importAssertions\` parser plugin, or \`@babel/plugin-syntax-import-assertions\`."`,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user