Skip to content

Commit

Permalink
Upgrade to ESLint v7 (#11857)
Browse files Browse the repository at this point in the history
* Upgrade to ESLint v7

* Upgrade eslint-plugin-import

* Update peer deps

* Remove max-len from ESLint config

* Update tests

* Only test babel-eslint-* packages in Node >=10

* Remove babel-eslint

* Fix linking in dev

* Add comment to Makefile

* Fix e2e tests

* Add --ignore-engines flag when installing in ESLint packages

* fix: convert tt.questionDot to Punctuator

* chore: update lockfile

Co-authored-by: Hu谩ng J霉nli脿ng <jlhwung@gmail.com>
  • Loading branch information
kaicataldo and JLHwung committed Jul 29, 2020
1 parent 95fcb3e commit 4ac9c7a
Show file tree
Hide file tree
Showing 36 changed files with 5,762 additions and 209 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.js
Expand Up @@ -14,8 +14,6 @@ module.exports = {
extends: "@babel/internal",
rules: {
"prettier/prettier": "error",
// TODO: remove after babel-eslint-config-internal is fully integrated into this repository.
"max-len": "off",
},
env: {
node: true,
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -257,6 +257,8 @@ publish-eslint:
bootstrap-only: lerna-bootstrap

yarn-install: clean-all
# Install dependencies in individual packages so that we can link them at the top level.
for package in eslint/*/; do yarn --ignore-engines --cwd $$package; done
# Gitpod prebuilds have a slow network connection, so we need more time
yarn --ignore-engines --network-timeout 100000

Expand Down
2 changes: 1 addition & 1 deletion eslint/babel-eslint-config-internal/package.json
Expand Up @@ -13,7 +13,7 @@
},
"main": "index.js",
"peerDependencies": {
"@babel/eslint-parser": "*",
"@babel/eslint-parser": "^7.10.4",
"eslint-plugin-flowtype": "^3.0.0"
}
}
4 changes: 4 additions & 0 deletions eslint/babel-eslint-config-internal/yarn.lock
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


7 changes: 3 additions & 4 deletions eslint/babel-eslint-parser/package.json
Expand Up @@ -19,8 +19,8 @@
},
"main": "lib/index.js",
"peerDependencies": {
"@babel/core": ">=7.2.0",
"eslint": ">=6.0.0"
"@babel/core": ">=7.10.4",
"eslint": ">=7.5.0"
},
"dependencies": {
"eslint-scope": "5.1.0",
Expand All @@ -29,9 +29,8 @@
},
"devDependencies": {
"@babel/core": "^7.10.4",
"@babel/eslint-shared-fixtures": "^7.10.4",
"dedent": "^0.7.0",
"eslint": "^6.0.1",
"eslint": "^7.5.0",
"lodash.clonedeep": "^4.5.0"
}
}
3 changes: 1 addition & 2 deletions eslint/babel-eslint-parser/src/convert/convertTokens.js
Expand Up @@ -135,6 +135,7 @@ function convertToken(token, source) {
type === tt.tilde ||
type === tt.doubleColon ||
type === tt.hash ||
type === tt.questionDot ||
type.isAssign
) {
token.type = "Punctuator";
Expand Down Expand Up @@ -172,8 +173,6 @@ function convertToken(token, source) {
} else if (type === tt.bigint) {
token.type = "Numeric";
token.value = `${token.value}n`;
} else if (type === tt.questionDot) {
token.value = type.label;
}
if (typeof token.type !== "string") {
// Acorn does not have rightAssociative
Expand Down
2 changes: 1 addition & 1 deletion eslint/babel-eslint-parser/test/index.js
Expand Up @@ -6,7 +6,7 @@ import { parseForESLint } from "../src";

const BABEL_OPTIONS = {
configFile: require.resolve(
"@babel/eslint-shared-fixtures/config/babel.config.js",
"../../babel-eslint-shared-fixtures/config/babel.config.js",
),
};
const PROPS_TO_REMOVE = [
Expand Down

0 comments on commit 4ac9c7a

Please sign in to comment.