Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb1bb7f
commit 1f53808
Showing
2 changed files
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 9 additions & 12 deletions
21
packages/babel-plugin-proposal-private-methods/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}, | ||
}; | ||
}); | ||
}); |