[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:
Huáng Jùnliàng
2021-05-14 09:55:40 -04:00
committed by GitHub
parent b670c11070
commit b3d35cd412
8 changed files with 49 additions and 29 deletions

View File

@@ -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\`."`,
);
});
});
});