Skip to content

Commit

Permalink
remove "version" options from syntax-import-assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Oct 14, 2020
1 parent 8bebffc commit b0601b1
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/babel-plugin-syntax-import-assertions/src/index.js
@@ -1,21 +1,13 @@
import { declare } from "@babel/helper-plugin-utils";

export default declare((api, { version }) => {
export default declare(api => {
api.assertVersion(7);

if (typeof version !== "string" || version !== "september-2020") {
throw new Error(
"The 'importAssertions' plugin requires a 'version' option," +
" representing the last proposal update. Currently, the" +
" only supported value is 'september-2020'.",
);
}

return {
name: "syntax-import-assertions",

manipulateOptions(opts, parserOpts) {
parserOpts.plugins.push(["importAssertions", { version }]);
parserOpts.plugins.push(["importAssertions"]);
},
};
});

0 comments on commit b0601b1

Please sign in to comment.