Update dev dependencies and fix linting errors (#10228)
* chore: Uppate dev dependencies * chore: Fix lint errors * chore: Format options.json files * chore: Fix stupid flow errors * Update test262 whitelist Seems test262-stream was updated and now these tests work.
This commit is contained in:
parent
6a9d2538e0
commit
4f0840ab88
@ -32,13 +32,13 @@
|
|||||||
"derequire": "^2.0.2",
|
"derequire": "^2.0.2",
|
||||||
"duplicate-package-checker-webpack-plugin": "^2.1.0",
|
"duplicate-package-checker-webpack-plugin": "^2.1.0",
|
||||||
"enhanced-resolve": "^3.0.0",
|
"enhanced-resolve": "^3.0.0",
|
||||||
"eslint": "^5.16.0",
|
"eslint": "^6.0.1",
|
||||||
"eslint-config-babel": "^9.0.0",
|
"eslint-config-babel": "^9.0.0",
|
||||||
"eslint-plugin-flowtype": "^3.8.2",
|
"eslint-plugin-flowtype": "^3.8.2",
|
||||||
"eslint-plugin-import": "^2.17.2",
|
"eslint-plugin-import": "^2.17.2",
|
||||||
"eslint-plugin-prettier": "^3.1.0",
|
"eslint-plugin-prettier": "^3.1.0",
|
||||||
"fancy-log": "^1.3.3",
|
"fancy-log": "^1.3.3",
|
||||||
"flow-bin": "^0.94.0",
|
"flow-bin": "^0.102.0",
|
||||||
"graceful-fs": "^4.1.15",
|
"graceful-fs": "^4.1.15",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-babel": "^8.0.0",
|
"gulp-babel": "^8.0.0",
|
||||||
@ -48,11 +48,11 @@
|
|||||||
"gulp-rename": "^1.4.0",
|
"gulp-rename": "^1.4.0",
|
||||||
"gulp-uglify": "^3.0.2",
|
"gulp-uglify": "^3.0.2",
|
||||||
"gulp-watch": "^5.0.1",
|
"gulp-watch": "^5.0.1",
|
||||||
"husky": "^2.3.0",
|
"husky": "^3.0.0",
|
||||||
"jest": "^24.8.0",
|
"jest": "^24.8.0",
|
||||||
"lerna": "^3.14.2",
|
"lerna": "^3.14.2",
|
||||||
"lerna-changelog": "^0.5.0",
|
"lerna-changelog": "^0.5.0",
|
||||||
"lint-staged": "^8.1.7",
|
"lint-staged": "^9.2.0",
|
||||||
"lodash": "^4.17.13",
|
"lodash": "^4.17.13",
|
||||||
"merge-stream": "^1.0.1",
|
"merge-stream": "^1.0.1",
|
||||||
"output-file-sync": "^2.0.0",
|
"output-file-sync": "^2.0.0",
|
||||||
|
|||||||
@ -92,7 +92,7 @@ const assertTest = function(stdout, stderr, opts, cwd) {
|
|||||||
if (
|
if (
|
||||||
// saveInFiles always creates an empty .babelrc, so lets exclude for now
|
// saveInFiles always creates an empty .babelrc, so lets exclude for now
|
||||||
filename !== ".babelrc" &&
|
filename !== ".babelrc" &&
|
||||||
!opts.inFiles.hasOwnProperty(filename)
|
!Object.prototype.hasOwnProperty.call(opts.inFiles, filename)
|
||||||
) {
|
) {
|
||||||
const expected = opts.outFiles[filename];
|
const expected = opts.outFiles[filename];
|
||||||
const actual = actualFiles[filename];
|
const actual = actualFiles[filename];
|
||||||
|
|||||||
@ -268,13 +268,11 @@ function babelrcLoadEnabled(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateConfigFile = makeWeakCache(
|
const validateConfigFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({
|
||||||
(file: ConfigFile): ValidatedFile => ({
|
|
||||||
filepath: file.filepath,
|
filepath: file.filepath,
|
||||||
dirname: file.dirname,
|
dirname: file.dirname,
|
||||||
options: validate("configfile", file.options),
|
options: validate("configfile", file.options),
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
const validateBabelrcFile = makeWeakCache(
|
const validateBabelrcFile = makeWeakCache(
|
||||||
(file: ConfigFile): ValidatedFile => ({
|
(file: ConfigFile): ValidatedFile => ({
|
||||||
@ -284,13 +282,11 @@ const validateBabelrcFile = makeWeakCache(
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const validateExtendFile = makeWeakCache(
|
const validateExtendFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({
|
||||||
(file: ConfigFile): ValidatedFile => ({
|
|
||||||
filepath: file.filepath,
|
filepath: file.filepath,
|
||||||
dirname: file.dirname,
|
dirname: file.dirname,
|
||||||
options: validate("extendsfile", file.options),
|
options: validate("extendsfile", file.options),
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build a config chain for just the programmatic options passed into Babel.
|
* Build a config chain for just the programmatic options passed into Babel.
|
||||||
@ -549,7 +545,7 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions {
|
|||||||
|
|
||||||
// "sourceMap" is just aliased to sourceMap, so copy it over as
|
// "sourceMap" is just aliased to sourceMap, so copy it over as
|
||||||
// we merge the options together.
|
// we merge the options together.
|
||||||
if (options.hasOwnProperty("sourceMap")) {
|
if (Object.prototype.hasOwnProperty.call(options, "sourceMap")) {
|
||||||
options.sourceMaps = options.sourceMap;
|
options.sourceMaps = options.sourceMap;
|
||||||
delete options.sourceMap;
|
delete options.sourceMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -278,7 +278,7 @@ export function assertConfigFileSearch(
|
|||||||
) {
|
) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`${msg(loc)} must be a undefined, a boolean, a string, ` +
|
`${msg(loc)} must be a undefined, a boolean, a string, ` +
|
||||||
`got ${JSON.stringify(value)}`,
|
`got ${JSON.stringify((value: any))}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ export function assertBabelrcSearch(
|
|||||||
} else if (!checkValidTest(value)) {
|
} else if (!checkValidTest(value)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` +
|
`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` +
|
||||||
`or an array of those, got ${JSON.stringify(value)}`,
|
`or an array of those, got ${JSON.stringify((value: any))}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (value: any);
|
return (value: any);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import type { PluginPasses } from "../../config";
|
import type { PluginPasses } from "../../config";
|
||||||
import convertSourceMap, { type SourceMap } from "convert-source-map";
|
import convertSourceMap, { typeof SourceMap } from "convert-source-map";
|
||||||
import generate from "@babel/generator";
|
import generate from "@babel/generator";
|
||||||
|
|
||||||
import type File from "./file";
|
import type File from "./file";
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import type { SourceMap } from "convert-source-map";
|
import typeof { SourceMap } from "convert-source-map";
|
||||||
import sourceMap from "source-map";
|
import sourceMap from "source-map";
|
||||||
|
|
||||||
export default function mergeSourceMap(
|
export default function mergeSourceMap(
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import traverse from "@babel/traverse";
|
import traverse from "@babel/traverse";
|
||||||
import type { SourceMap } from "convert-source-map";
|
import typeof { SourceMap } from "convert-source-map";
|
||||||
|
|
||||||
import type { ResolvedConfig, PluginPasses } from "../config";
|
import type { ResolvedConfig, PluginPasses } from "../config";
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parserOpts": {"createParenthesizedExpressions": true}
|
"parserOpts": { "createParenthesizedExpressions": true }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [["proposal-private-methods", { "loose": false }]]
|
||||||
["proposal-private-methods", { "loose": false }]
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [["proposal-private-methods", { "loose": true }]]
|
||||||
["proposal-private-methods", { "loose": true }]
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -169,9 +169,7 @@ export default function get(entryLoc): Array<Suite> {
|
|||||||
|
|
||||||
if (minimumVersion == null) {
|
if (minimumVersion == null) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`'minNodeVersion' has invalid semver format: ${
|
`'minNodeVersion' has invalid semver format: ${taskOpts.minNodeVersion}`,
|
||||||
taskOpts.minNodeVersion
|
|
||||||
}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -77,7 +77,7 @@ const assertTest = function(stdout, stderr, opts) {
|
|||||||
const actualFiles = readDir(path.join(tmpLoc));
|
const actualFiles = readDir(path.join(tmpLoc));
|
||||||
|
|
||||||
Object.keys(actualFiles).forEach(function(filename) {
|
Object.keys(actualFiles).forEach(function(filename) {
|
||||||
if (!opts.inFiles.hasOwnProperty(filename)) {
|
if (!Object.prototype.hasOwnProperty.call(opts.inFiles, filename)) {
|
||||||
const expected = opts.outFiles[filename];
|
const expected = opts.outFiles[filename];
|
||||||
const actual = actualFiles[filename];
|
const actual = actualFiles[filename];
|
||||||
|
|
||||||
|
|||||||
@ -1137,9 +1137,7 @@ export default class ExpressionParser extends LValParser {
|
|||||||
if (node.property.name !== propertyName || containsEsc) {
|
if (node.property.name !== propertyName || containsEsc) {
|
||||||
this.raise(
|
this.raise(
|
||||||
node.property.start,
|
node.property.start,
|
||||||
`The only valid meta property for ${meta.name} is ${
|
`The only valid meta property for ${meta.name} is ${meta.name}.${propertyName}`,
|
||||||
meta.name
|
|
||||||
}.${propertyName}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -369,9 +369,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
|||||||
) {
|
) {
|
||||||
throw this.unexpected(
|
throw this.unexpected(
|
||||||
pattern.start,
|
pattern.start,
|
||||||
`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${
|
"Name in a signature must be an Identifier, ObjectPattern or ArrayPattern," +
|
||||||
pattern.type
|
`instead got ${pattern.type}`,
|
||||||
}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return pattern;
|
return pattern;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"throws":"Identifier 'foo' has already been declared (2:9)"
|
"throws": "Identifier 'foo' has already been declared (2:9)"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": ["placeholders"],
|
||||||
"placeholders"
|
|
||||||
],
|
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7)"
|
"throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": ["placeholders"],
|
||||||
"placeholders"
|
|
||||||
],
|
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:16)"
|
"throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:16)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": ["placeholders"],
|
||||||
"placeholders"
|
|
||||||
],
|
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:16)"
|
"throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:16)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": ["placeholders"],
|
||||||
"placeholders"
|
|
||||||
],
|
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7)"
|
"throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": ["placeholders"],
|
||||||
"placeholders"
|
|
||||||
],
|
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)"
|
"throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": ["placeholders"],
|
||||||
"placeholders"
|
|
||||||
],
|
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)"
|
"throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"plugins": [
|
"plugins": ["typescript"],
|
||||||
"typescript"
|
|
||||||
],
|
|
||||||
"throws": "Template literal types cannot have any substitution (1:14)"
|
"throws": "Template literal types cannot have any substitution (1:14)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"plugins": [
|
"plugins": ["typescript"],
|
||||||
"typescript"
|
|
||||||
],
|
|
||||||
"throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
|
"throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"plugins": [
|
"plugins": ["typescript"],
|
||||||
"typescript"
|
|
||||||
],
|
|
||||||
"throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
|
"throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"plugins": [
|
"plugins": ["typescript"],
|
||||||
"typescript"
|
|
||||||
],
|
|
||||||
"throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
|
"throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
|
||||||
}
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [["proposal-pipeline-operator", { "proposal": "fsharp" }]],
|
||||||
["proposal-pipeline-operator", { "proposal": "fsharp" }]
|
|
||||||
],
|
|
||||||
"parserOpts": {
|
"parserOpts": {
|
||||||
"allowReturnOutsideFunction": true
|
"allowReturnOutsideFunction": true
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [["proposal-pipeline-operator", { "proposal": "fsharp" }]],
|
||||||
["proposal-pipeline-operator", { "proposal": "fsharp" }]
|
|
||||||
],
|
|
||||||
"parserOpts": {
|
"parserOpts": {
|
||||||
"allowReturnOutsideFunction": true
|
"allowReturnOutsideFunction": true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [["proposal-pipeline-operator", { "proposal": "smart" }]],
|
||||||
["proposal-pipeline-operator", { "proposal": "smart" }]
|
|
||||||
],
|
|
||||||
"parserOpts": {
|
"parserOpts": {
|
||||||
"allowReturnOutsideFunction": true
|
"allowReturnOutsideFunction": true
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [["proposal-pipeline-operator", { "proposal": "smart" }]],
|
||||||
["proposal-pipeline-operator", { "proposal": "smart" }]
|
|
||||||
],
|
|
||||||
"parserOpts": {
|
"parserOpts": {
|
||||||
"allowReturnOutsideFunction": true
|
"allowReturnOutsideFunction": true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
{
|
{
|
||||||
"parserOpts": {
|
"parserOpts": {
|
||||||
"plugins": ["classProperties", "classPrivateProperties", "classPrivateMethods"]
|
"plugins": [
|
||||||
|
"classProperties",
|
||||||
|
"classPrivateProperties",
|
||||||
|
"classPrivateMethods"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"plugins": ["transform-modules-commonjs"]
|
"plugins": ["transform-modules-commonjs"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -314,9 +314,7 @@ export default declare((api, options, dirname) => {
|
|||||||
node.callee = t.memberExpression(
|
node.callee = t.memberExpression(
|
||||||
t.callExpression(
|
t.callExpression(
|
||||||
this.addDefaultImport(
|
this.addDefaultImport(
|
||||||
`${moduleName}/${corejsRoot}/instance/${
|
`${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,
|
||||||
InstanceProperties[propertyName].path
|
|
||||||
}`,
|
|
||||||
`${propertyName}InstanceProperty`,
|
`${propertyName}InstanceProperty`,
|
||||||
),
|
),
|
||||||
[context2],
|
[context2],
|
||||||
@ -407,9 +405,7 @@ export default declare((api, options, dirname) => {
|
|||||||
path.replaceWith(
|
path.replaceWith(
|
||||||
t.callExpression(
|
t.callExpression(
|
||||||
this.addDefaultImport(
|
this.addDefaultImport(
|
||||||
`${moduleName}/${corejsRoot}/instance/${
|
`${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,
|
||||||
InstanceProperties[propertyName].path
|
|
||||||
}`,
|
|
||||||
`${propertyName}InstanceProperty`,
|
`${propertyName}InstanceProperty`,
|
||||||
),
|
),
|
||||||
[object],
|
[object],
|
||||||
@ -421,9 +417,7 @@ export default declare((api, options, dirname) => {
|
|||||||
|
|
||||||
path.replaceWith(
|
path.replaceWith(
|
||||||
this.addDefaultImport(
|
this.addDefaultImport(
|
||||||
`${modulePath}/${corejsRoot}/${
|
`${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}`,
|
||||||
StaticProperties[objectName][propertyName].path
|
|
||||||
}`,
|
|
||||||
`${objectName}$${propertyName}`,
|
`${objectName}$${propertyName}`,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]]
|
"plugins": [
|
||||||
|
["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]]
|
"plugins": [
|
||||||
|
["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]]
|
"plugins": [
|
||||||
|
["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,9 +34,7 @@ export default function() {
|
|||||||
post() {
|
post() {
|
||||||
if (this.opts.debug && this.regeneratorImportExcluded) {
|
if (this.opts.debug && this.regeneratorImportExcluded) {
|
||||||
console.log(
|
console.log(
|
||||||
`\n[${
|
`\n[${this.file.opts.filename}] Based on your targets, regenerator-runtime import excluded.`,
|
||||||
this.file.opts.filename
|
|
||||||
}] Based on your targets, regenerator-runtime import excluded.`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -22,9 +22,7 @@ export default function() {
|
|||||||
post() {
|
post() {
|
||||||
if (this.opts.debug && this.usesRegenerator) {
|
if (this.opts.debug && this.usesRegenerator) {
|
||||||
console.log(
|
console.log(
|
||||||
`\n[${
|
`\n[${this.file.opts.filename}] Based on your code and targets, added regenerator-runtime.`,
|
||||||
this.file.opts.filename
|
|
||||||
}] Based on your code and targets, added regenerator-runtime.`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -40,7 +40,7 @@ const isArray =
|
|||||||
*/
|
*/
|
||||||
function loadBuiltin(builtinTable, name) {
|
function loadBuiltin(builtinTable, name) {
|
||||||
if (isArray(name) && typeof name[0] === "string") {
|
if (isArray(name) && typeof name[0] === "string") {
|
||||||
if (builtinTable.hasOwnProperty(name[0])) {
|
if (Object.prototype.hasOwnProperty.call(builtinTable, name[0])) {
|
||||||
return [builtinTable[name[0]]].concat(name.slice(1));
|
return [builtinTable[name[0]]].concat(name.slice(1));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -66,7 +66,7 @@ function processOptions(options) {
|
|||||||
if (
|
if (
|
||||||
isArray(preset) &&
|
isArray(preset) &&
|
||||||
typeof preset[0] === "object" &&
|
typeof preset[0] === "object" &&
|
||||||
preset[0].hasOwnProperty("buildPreset")
|
Object.prototype.hasOwnProperty.call(preset[0], "buildPreset")
|
||||||
) {
|
) {
|
||||||
preset[0] = { ...preset[0], buildPreset: preset[0].buildPreset };
|
preset[0] = { ...preset[0], buildPreset: preset[0].buildPreset };
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ export const buildExternalHelpers = babelBuildExternalHelpers;
|
|||||||
* Registers a named plugin for use with Babel.
|
* Registers a named plugin for use with Babel.
|
||||||
*/
|
*/
|
||||||
export function registerPlugin(name: string, plugin: Object | Function): void {
|
export function registerPlugin(name: string, plugin: Object | Function): void {
|
||||||
if (availablePlugins.hasOwnProperty(name)) {
|
if (Object.prototype.hasOwnProperty.call(availablePlugins, name)) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`A plugin named "${name}" is already registered, it will be overridden`,
|
`A plugin named "${name}" is already registered, it will be overridden`,
|
||||||
);
|
);
|
||||||
@ -135,7 +135,7 @@ export function registerPlugins(newPlugins: {
|
|||||||
* Registers a named preset for use with Babel.
|
* Registers a named preset for use with Babel.
|
||||||
*/
|
*/
|
||||||
export function registerPreset(name: string, preset: Object | Function): void {
|
export function registerPreset(name: string, preset: Object | Function): void {
|
||||||
if (availablePresets.hasOwnProperty(name)) {
|
if (Object.prototype.hasOwnProperty.call(availablePresets, name)) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`A preset named "${name}" is already registered, it will be overridden`,
|
`A preset named "${name}" is already registered, it will be overridden`,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -149,7 +149,7 @@ export function normalizeReplacements(
|
|||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
} else if (typeof replacements === "object" || replacements == null) {
|
} else if (typeof replacements === "object" || replacements == null) {
|
||||||
return replacements || undefined;
|
return (replacements: any) || undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
@ -45,9 +45,7 @@ export default function populatePlaceholders(
|
|||||||
(replacements && replacements[placeholder.name]) || null,
|
(replacements && replacements[placeholder.name]) || null,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
e.message = `@babel/template placeholder "${placeholder.name}": ${
|
e.message = `@babel/template placeholder "${placeholder.name}": ${e.message}`;
|
||||||
e.message
|
|
||||||
}`;
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -25,9 +25,7 @@ export default function traverse(
|
|||||||
if (parent.type !== "Program" && parent.type !== "File") {
|
if (parent.type !== "Program" && parent.type !== "File") {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"You must pass a scope and parentPath unless traversing a Program/File. " +
|
"You must pass a scope and parentPath unless traversing a Program/File. " +
|
||||||
`Instead of that you tried to traverse a ${
|
`Instead of that you tried to traverse a ${parent.type} node without ` +
|
||||||
parent.type
|
|
||||||
} node without ` +
|
|
||||||
"passing scope and parentPath.",
|
"passing scope and parentPath.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,9 +103,7 @@ for (const type in t.NODE_FIELDS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < t.TYPES.length; i++) {
|
for (let i = 0; i < t.TYPES.length; i++) {
|
||||||
let decl = `declare function is${
|
let decl = `declare function is${t.TYPES[i]}(node: ?Object, opts?: ?Object): boolean`;
|
||||||
t.TYPES[i]
|
|
||||||
}(node: ?Object, opts?: ?Object): boolean`;
|
|
||||||
|
|
||||||
if (t.NODE_FIELDS[t.TYPES[i]]) {
|
if (t.NODE_FIELDS[t.TYPES[i]]) {
|
||||||
decl += ` %checks (node instanceof ${NODE_PREFIX}${t.TYPES[i]})`;
|
decl += ` %checks (node instanceof ${NODE_PREFIX}${t.TYPES[i]})`;
|
||||||
|
|||||||
@ -18,7 +18,8 @@ import is from "../../validators/is";
|
|||||||
function assert(type: string, node: Object, opts?: Object): void {
|
function assert(type: string, node: Object, opts?: Object): void {
|
||||||
if (!is(type, node, opts)) {
|
if (!is(type, node, opts)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
\`Expected type "\${type}" with option \${JSON.stringify(opts)}, but instead got "\${node.type}".\`,
|
\`Expected type "\${type}" with option \${JSON.stringify((opts: any))}, \` +
|
||||||
|
\`but instead got "\${node.type}".\`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}\n\n`;
|
}\n\n`;
|
||||||
|
|||||||
@ -104,9 +104,7 @@ for (const type in t.NODE_FIELDS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < t.TYPES.length; i++) {
|
for (let i = 0; i < t.TYPES.length; i++) {
|
||||||
let decl = `export function is${
|
let decl = `export function is${t.TYPES[i]}(node: object | null | undefined, opts?: object | null): `;
|
||||||
t.TYPES[i]
|
|
||||||
}(node: object | null | undefined, opts?: object | null): `;
|
|
||||||
|
|
||||||
if (t.NODE_FIELDS[t.TYPES[i]]) {
|
if (t.NODE_FIELDS[t.TYPES[i]]) {
|
||||||
decl += `node is ${t.TYPES[i]};`;
|
decl += `node is ${t.TYPES[i]};`;
|
||||||
|
|||||||
@ -4,6 +4,6 @@ import isNode from "../validators/isNode";
|
|||||||
export default function assertNode(node?: Object): void {
|
export default function assertNode(node?: Object): void {
|
||||||
if (!isNode(node)) {
|
if (!isNode(node)) {
|
||||||
const type = (node && node.type) || JSON.stringify(node);
|
const type = (node && node.type) || JSON.stringify(node);
|
||||||
throw new TypeError(`Not a valid node of type "${type}"`);
|
throw new TypeError(`Not a valid node of type "${(type: any)}"`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ function assert(type: string, node: Object, opts?: Object): void {
|
|||||||
if (!is(type, node, opts)) {
|
if (!is(type, node, opts)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Expected type "${type}" with option ${JSON.stringify(
|
`Expected type "${type}" with option ${JSON.stringify(
|
||||||
opts,
|
(opts: any),
|
||||||
)}, but instead got "${node.type}".`,
|
)}, but instead got "${node.type}".`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,9 +8,7 @@ export default function builder(type: string, ...args: Array<any>): Object {
|
|||||||
const countArgs = args.length;
|
const countArgs = args.length;
|
||||||
if (countArgs > keys.length) {
|
if (countArgs > keys.length) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${
|
`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`,
|
||||||
keys.length
|
|
||||||
}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -282,23 +282,6 @@ built-ins/RegExp/property-escapes/unsupported-property-Line_Break-with-value.js(
|
|||||||
built-ins/RegExp/property-escapes/unsupported-property-Line_Break-with-value.js(strict mode)
|
built-ins/RegExp/property-escapes/unsupported-property-Line_Break-with-value.js(strict mode)
|
||||||
built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(default)
|
built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(default)
|
||||||
built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(strict mode)
|
built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(strict mode)
|
||||||
language/comments/hashbang/escaped-bang-041.js(default)
|
|
||||||
language/comments/hashbang/escaped-bang-u0021.js(default)
|
|
||||||
language/comments/hashbang/escaped-bang-u21.js(default)
|
|
||||||
language/comments/hashbang/escaped-bang-x21.js(default)
|
|
||||||
language/comments/hashbang/escaped-hash-043.js(default)
|
|
||||||
language/comments/hashbang/escaped-hash-u0023.js(default)
|
|
||||||
language/comments/hashbang/escaped-hash-u23.js(default)
|
|
||||||
language/comments/hashbang/escaped-hash-x23.js(default)
|
|
||||||
language/comments/hashbang/escaped-hashbang.js(default)
|
|
||||||
language/comments/hashbang/multi-line-comment.js(default)
|
|
||||||
language/comments/hashbang/preceding-directive-prologue-sc.js(default)
|
|
||||||
language/comments/hashbang/preceding-directive-prologue.js(default)
|
|
||||||
language/comments/hashbang/preceding-empty-statement.js(default)
|
|
||||||
language/comments/hashbang/preceding-hashbang.js(default)
|
|
||||||
language/comments/hashbang/preceding-line-comment.js(default)
|
|
||||||
language/comments/hashbang/preceding-multi-line-comment.js(default)
|
|
||||||
language/comments/hashbang/preceding-whitespace.js(default)
|
|
||||||
language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(default)
|
language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(default)
|
||||||
language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(strict mode)
|
language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(strict mode)
|
||||||
language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(default)
|
language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(default)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user