refactor: add @babel/helper-validator-option (#12006)

* refactor: add @babel/helper-validator-option

* refactor: simplify validateTopLevelOptions

* perf: the recursive version is not practically fast

* Update packages/babel-helper-validator-option/README.md

Co-authored-by: Brian Ng <bng412@gmail.com>

* Update packages/babel-helper-validator-option/src/validator.js

* fix: incorrect type annotation

* refactor: use babel/helper-option-validator in babel/compat-data

* chore: fix flow types error

* Address review comments

* address review comments

Co-authored-by: Brian Ng <bng412@gmail.com>
This commit is contained in:
Huáng Jùnliàng
2020-09-24 16:23:35 -04:00
committed by GitHub
parent 0d32e3fc36
commit f2da186714
19 changed files with 374 additions and 196 deletions

View File

@@ -106,7 +106,10 @@ module.exports = function (api) {
plugins: [
// TODO: Use @babel/preset-flow when
// https://github.com/babel/babel/issues/7233 is fixed
"@babel/plugin-transform-flow-strip-types",
[
"@babel/plugin-transform-flow-strip-types",
{ allowDeclareFields: true },
],
[
"@babel/proposal-object-rest-spread",
{ useBuiltIns: true, loose: true },