Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support ESLint 8.x #85

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
- name: Install Packages
run: npm install
- name: Lint
Expand All @@ -28,45 +28,51 @@ jobs:

strategy:
matrix:
eslint: [7]
node: [14]
eslint: [8]
node: [16]
os: [ubuntu-latest]
include:
# On other platforms
- eslint: 7
node: 14
- eslint: 8
node: 16
os: windows-latest
- eslint: 7
node: 14
- eslint: 8
node: 16
os: macos-latest
# On old Node.js versions
- eslint: 7
- eslint: 8
node: 14
os: ubuntu-latest
- eslint: 8
node: 12
os: ubuntu-latest
- eslint: 7
node: 10
os: ubuntu-latest
# On old ESLint versions
- eslint: 7
node: 16
os: ubuntu-latest
- eslint: 6
node: 14
node: 16
os: ubuntu-latest
- eslint: 5
node: 14
node: 16
os: ubuntu-latest
- eslint: 4
node: 14
node: 16
os: ubuntu-latest
# On the minimum supported ESLint/Node.js version
- eslint: 4
node: "8.10"
- eslint: 4.19.1
node: 10
os: ubuntu-latest

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install Packages
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "4.1.0",
"description": "ESLint plugin about ECMAScript syntactic features.",
"engines": {
"node": ">=8.10.0"
"node": "^10.0.0 || ^12.0.0 || >=14.0.0"
},
"main": "lib/index.js",
"files": [
Expand All @@ -13,26 +13,26 @@
"eslint": ">=4.19.1"
},
"dependencies": {
"eslint-utils": "^2.0.0",
"eslint-utils": "^3.0.0",
"regexpp": "^3.0.0"
},
"devDependencies": {
"@mysticatea/eslint-plugin": "^13.0.0",
"@typescript-eslint/parser": "^4.8.2",
"@typescript-eslint/parser": "^5.0.0",
"@vuepress/plugin-pwa": "^1.2.0",
"acorn": "^7.1.0",
"codecov": "^3.8.1",
"eslint": "^7.10.0",
"eslint4b": "^7.10.0",
"espree": "^7.0.0",
"eslint": "^8.0.0",
"eslint4b": "^7.32.0",
"espree": "^9.0.0",
"globals": "^12.0.0",
"mocha": "^6.2.0",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.1",
"opener": "^1.5.1",
"rimraf": "^3.0.0",
"semver": "^6.3.0",
"typescript": "^4.1.2",
"typescript": "^4.4.3",
"vue-eslint-editor": "^1.1.0",
"vuepress": "^1.2.0"
},
Expand Down
6 changes: 3 additions & 3 deletions scripts/update-docs-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

const fs = require("fs")
const path = require("path")
const { CLIEngine } = require("eslint")
const { ESLint } = require("eslint")
const { rules } = require("./rules")
const { version } = require("../package.json")

Expand All @@ -15,8 +15,8 @@ const configRoot = path.resolve(__dirname, "../lib/configs/")
const configs = fs.readdirSync(configRoot).map(filename => {
const id = `plugin:es/${path.basename(filename, ".js")}`
const configFile = path.join(configRoot, filename)
const engine = new CLIEngine({ configFile, useEslintrc: false })
const config = engine.getConfigForFile("a.js")
const engine = new ESLint({ configFile, useEslintrc: false })
const config = engine.calculateConfigForFile("a.js")
const ruleIds = new Set(Object.keys(config.rules))
return { id, ruleIds }
})
Expand Down
6 changes: 2 additions & 4 deletions scripts/update-lib-configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

const fs = require("fs")
const path = require("path")
const { CLIEngine } = require("eslint")
const { ESLint } = require("eslint")
const { categories } = require("./rules")
const Root = path.resolve(__dirname, "../lib/configs")

Expand Down Expand Up @@ -59,6 +59,4 @@ for (const { experimental, revision, rules } of Object.values(categories)) {
}
}

CLIEngine.outputFixes(
new CLIEngine({ fix: true }).executeOnFiles(["lib/configs"]),
)
ESLint.outputFixes(new ESLint({ fix: true }).lintFiles(["lib/configs"]))
6 changes: 2 additions & 4 deletions scripts/update-lib-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

const fs = require("fs")
const path = require("path")
const { CLIEngine } = require("eslint")
const { ESLint } = require("eslint")
const { rules } = require("./rules")
const collator = new Intl.Collator("en", { numeric: true })

Expand Down Expand Up @@ -54,6 +54,4 @@ module.exports = {
`,
)

CLIEngine.outputFixes(
new CLIEngine({ fix: true }).executeOnFiles(["lib/index.js"]),
)
ESLint.outputFixes(new ESLint({ fix: true }).lintFiles(["lib/index.js"]))