Skip to content

Commit

Permalink
Update dev dependencies and fix linting errors (#10228)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
danez committed Jul 27, 2019
1 parent 6a9d253 commit 4f0840a
Show file tree
Hide file tree
Showing 242 changed files with 2,866 additions and 1,719 deletions.
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -32,13 +32,13 @@
"derequire": "^2.0.2",
"duplicate-package-checker-webpack-plugin": "^2.1.0",
"enhanced-resolve": "^3.0.0",
"eslint": "^5.16.0",
"eslint": "^6.0.1",
"eslint-config-babel": "^9.0.0",
"eslint-plugin-flowtype": "^3.8.2",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-prettier": "^3.1.0",
"fancy-log": "^1.3.3",
"flow-bin": "^0.94.0",
"flow-bin": "^0.102.0",
"graceful-fs": "^4.1.15",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
Expand All @@ -48,11 +48,11 @@
"gulp-rename": "^1.4.0",
"gulp-uglify": "^3.0.2",
"gulp-watch": "^5.0.1",
"husky": "^2.3.0",
"husky": "^3.0.0",
"jest": "^24.8.0",
"lerna": "^3.14.2",
"lerna-changelog": "^0.5.0",
"lint-staged": "^8.1.7",
"lint-staged": "^9.2.0",
"lodash": "^4.17.13",
"merge-stream": "^1.0.1",
"output-file-sync": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-cli/test/index.js
Expand Up @@ -92,7 +92,7 @@ const assertTest = function(stdout, stderr, opts, cwd) {
if (
// saveInFiles always creates an empty .babelrc, so lets exclude for now
filename !== ".babelrc" &&
!opts.inFiles.hasOwnProperty(filename)
!Object.prototype.hasOwnProperty.call(opts.inFiles, filename)
) {
const expected = opts.outFiles[filename];
const actual = actualFiles[filename];
Expand Down
26 changes: 11 additions & 15 deletions packages/babel-core/src/config/config-chain.js
Expand Up @@ -268,13 +268,11 @@ function babelrcLoadEnabled(
});
}

const validateConfigFile = makeWeakCache(
(file: ConfigFile): ValidatedFile => ({
filepath: file.filepath,
dirname: file.dirname,
options: validate("configfile", file.options),
}),
);
const validateConfigFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({
filepath: file.filepath,
dirname: file.dirname,
options: validate("configfile", file.options),
}));

const validateBabelrcFile = makeWeakCache(
(file: ConfigFile): ValidatedFile => ({
Expand All @@ -284,13 +282,11 @@ const validateBabelrcFile = makeWeakCache(
}),
);

const validateExtendFile = makeWeakCache(
(file: ConfigFile): ValidatedFile => ({
filepath: file.filepath,
dirname: file.dirname,
options: validate("extendsfile", file.options),
}),
);
const validateExtendFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({
filepath: file.filepath,
dirname: file.dirname,
options: validate("extendsfile", file.options),
}));

/**
* Build a config chain for just the programmatic options passed into Babel.
Expand Down Expand Up @@ -549,7 +545,7 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions {

// "sourceMap" is just aliased to sourceMap, so copy it over as
// we merge the options together.
if (options.hasOwnProperty("sourceMap")) {
if (Object.prototype.hasOwnProperty.call(options, "sourceMap")) {
options.sourceMaps = options.sourceMap;
delete options.sourceMap;
}
Expand Down
Expand Up @@ -278,7 +278,7 @@ export function assertConfigFileSearch(
) {
throw new Error(
`${msg(loc)} must be a undefined, a boolean, a string, ` +
`got ${JSON.stringify(value)}`,
`got ${JSON.stringify((value: any))}`,
);
}

Expand All @@ -302,7 +302,7 @@ export function assertBabelrcSearch(
} else if (!checkValidTest(value)) {
throw new Error(
`${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);
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-core/src/transformation/file/generate.js
@@ -1,7 +1,7 @@
// @flow

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 type File from "./file";
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-core/src/transformation/file/merge-map.js
@@ -1,6 +1,6 @@
// @flow

import type { SourceMap } from "convert-source-map";
import typeof { SourceMap } from "convert-source-map";
import sourceMap from "source-map";

export default function mergeSourceMap(
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-core/src/transformation/index.js
@@ -1,6 +1,6 @@
// @flow
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";

Expand Down
@@ -1,3 +1,3 @@
{
"parserOpts": {"createParenthesizedExpressions": true}
"parserOpts": { "createParenthesizedExpressions": true }
}
@@ -1,5 +1,3 @@
{
"plugins": [
["proposal-private-methods", { "loose": false }]
]
"plugins": [["proposal-private-methods", { "loose": false }]]
}
@@ -1,5 +1,3 @@
{
"plugins": [
["proposal-private-methods", { "loose": true }]
]
"plugins": [["proposal-private-methods", { "loose": true }]]
}
4 changes: 1 addition & 3 deletions packages/babel-helper-fixtures/src/index.js
Expand Up @@ -169,9 +169,7 @@ export default function get(entryLoc): Array<Suite> {

if (minimumVersion == null) {
throw new Error(
`'minNodeVersion' has invalid semver format: ${
taskOpts.minNodeVersion
}`,
`'minNodeVersion' has invalid semver format: ${taskOpts.minNodeVersion}`,
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-node/test/index.js
Expand Up @@ -77,7 +77,7 @@ const assertTest = function(stdout, stderr, opts) {
const actualFiles = readDir(path.join(tmpLoc));

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 actual = actualFiles[filename];

Expand Down
4 changes: 1 addition & 3 deletions packages/babel-parser/src/parser/expression.js
Expand Up @@ -1137,9 +1137,7 @@ export default class ExpressionParser extends LValParser {
if (node.property.name !== propertyName || containsEsc) {
this.raise(
node.property.start,
`The only valid meta property for ${meta.name} is ${
meta.name
}.${propertyName}`,
`The only valid meta property for ${meta.name} is ${meta.name}.${propertyName}`,
);
}

Expand Down
5 changes: 2 additions & 3 deletions packages/babel-parser/src/plugins/typescript/index.js
Expand Up @@ -369,9 +369,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
) {
throw this.unexpected(
pattern.start,
`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${
pattern.type
}`,
"Name in a signature must be an Identifier, ObjectPattern or ArrayPattern," +
`instead got ${pattern.type}`,
);
}
return pattern;
Expand Down
@@ -1,3 +1,3 @@
{
"throws": "Unexpected token, expected \",\" (1:12)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (4:6)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (3:4)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (4:6)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (3:4)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (2:15)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (1:35)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (3:11)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (2:28)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (3:6)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (3:6)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (2:6)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (2:9)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (2:4)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (2:4)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'f' has already been declared (1:28)"
}
}
@@ -1,4 +1,4 @@
{
"sourceType": "module",
"throws":"Identifier 'foo' has already been declared (2:9)"
"throws": "Identifier 'foo' has already been declared (2:9)"
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (3:6)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'f' has already been declared (1:28)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'foo' has already been declared (1:9)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'a' has already been declared (3:8)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Identifier 'i' has already been declared (2:8)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Binding 'eval' in strict mode (1:36)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Binding 'arguments' in strict mode (1:36)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Binding 'eval' in strict mode (1:47)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Binding 'arguments' in strict mode (1:47)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Assigning to 'eval' in strict mode (1:32)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Assigning to 'arguments' in strict mode (1:32)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Assigning to 'eval' in strict mode (1:34)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Assigning to 'eval' in strict mode (1:34)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Assigning to 'arguments' in strict mode (1:34)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Assigning to 'arguments' in strict mode (1:34)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Assigning to 'eval' in strict mode (1:32)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Assigning to 'eval' in strict mode (1:32)"
}
}

0 comments on commit 4f0840a

Please sign in to comment.