Skip to content

Commit

Permalink
Move private methods plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Nov 29, 2018
1 parent cb1bb7f commit 1f53808
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Expand Up @@ -13,7 +13,7 @@
],
"dependencies": {
"@babel/helper-plugin-utils": "^7.0.0",
"@babel/plugin-class-features": "^7.1.4"
"@babel/helper-create-class-features-plugin": "^7.1.4"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
Expand Down
21 changes: 9 additions & 12 deletions packages/babel-plugin-proposal-private-methods/src/index.js
@@ -1,25 +1,22 @@
/* eslint-disable local-rules/plugin-name */

import { declare } from "@babel/helper-plugin-utils";
import pluginClassFeatures, {
enableFeature,
import {
createClassFeaturePlugin,
FEATURES,
} from "@babel/plugin-class-features";
} from "@babel/helper-create-class-features-plugin";

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

const { loose } = options;

return {
return createClassFeaturePlugin({
name: "proposal-private-methods",

inherits: pluginClassFeatures,
feature: FEATURES.privateMethods,
loose: options.loose,

manipulateOptions(opts, parserOpts) {
parserOpts.plugins.push("classPrivateMethods");
},

pre() {
enableFeature(this.file, FEATURES.privateMethods, loose);
},
};
});
});

0 comments on commit 1f53808

Please sign in to comment.