Make @babel/plugin-class-features a normal helper package (#9083)
* Make @babel/plugin-class-features a normal helper package This effectively disallows using it directly. * Rename helper * Style * Don't add prefix to plugin name * Move private methods plugin
This commit is contained in:
@@ -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);
|
||||
},
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user