Skip to content

Commit

Permalink
feat: support ESLint 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Oct 30, 2021
1 parent d9a116f commit c3f23be
Show file tree
Hide file tree
Showing 8 changed files with 1,259 additions and 1,364 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Expand Up @@ -12,21 +12,21 @@ jobs:

strategy:
matrix:
node-version: [15.x]
node: [16]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: "${{ matrix.node-version }}"
node-version: ${{ matrix.node }}

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
key: node_modules-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}

- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/test.yml
Expand Up @@ -3,7 +3,7 @@ name: Test
on:
push:
branches:
- "main"
- main
pull_request:

jobs:
Expand All @@ -12,25 +12,26 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
node: [10, 12, 14, 16]
eslint: [7, 8]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: "${{ matrix.node-version }}"
node-version: ${{ matrix.node }}

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
key: node_modules-${{ matrix.node }}-${{ matrix.eslint }}-${{ hashFiles('package-lock.json') }}

- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci
run: npm ci && npm install eslint@${{ matrix.eslint }}

- name: Jest
run: npx --no-install jest --coverage
1 change: 1 addition & 0 deletions examples/.eslintrc.js
Expand Up @@ -236,6 +236,7 @@ module.exports = {
// These files are used in README.md.
files: ["readme-*.js"],
parser: "babel-eslint",
// parser: "@babel/eslint-parser",
},
{
// TypeScript.
Expand Down
2,578 changes: 1,232 additions & 1,346 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions package.json
Expand Up @@ -10,16 +10,19 @@
"examples": "eslint --rulesdir src --no-ignore --fix-dry-run --format json --report-unused-disable-directives examples --ext .js,.ts,.vue,.md"
},
"devDependencies": {
"@typescript-eslint/parser": "4.15.2",
"@typescript-eslint/parser": "^5.2.0",
"babel-eslint": "10.1.0",
"doctoc": "2.0.0",
"eslint": "7.21.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jest": "24.1.5",
"eslint-plugin-markdown": "2.0.0",
"eslint-plugin-vue": "7.6.0",
"doctoc": "^2.0.1",
"eslint": "^8.1.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.2.2",
"eslint-plugin-markdown": "^2.2.1",
"eslint-plugin-vue": "^7.20.0",
"jest": "26.6.3",
"prettier": "2.2.1",
"typescript": "4.2.2"
},
"peerDependencies": {
"eslint": "^7.0.0 || ^8.0.0"
}
}
2 changes: 1 addition & 1 deletion src/shared.js
Expand Up @@ -752,7 +752,7 @@ function sortSpecifierItems(items) {
compare(itemA.node.local.name, itemB.node.local.name) ||
// Keep the original order if the names are the same. It’s not worth
// trying to compare anything else, `import {a, a} from "mod"` is a syntax
// error anyway (but babel-eslint kind of supports it).
// error anyway (but @babel/eslint-parser kind of supports it).
// istanbul ignore next
itemA.index - itemB.index
);
Expand Down
2 changes: 2 additions & 0 deletions test/exports.test.js
Expand Up @@ -1109,6 +1109,8 @@ const javascriptRuleTester = new RuleTester({

const flowRuleTester = new RuleTester({
parser: require.resolve("babel-eslint"),
// parser: require.resolve("@babel/eslint-parser"),
// parserOptions: { requireConfigFile: false },
});

const typescriptRuleTester = new RuleTester({
Expand Down
2 changes: 2 additions & 0 deletions test/imports.test.js
Expand Up @@ -1943,6 +1943,8 @@ const javascriptRuleTester = new RuleTester({

const flowRuleTester = new RuleTester({
parser: require.resolve("babel-eslint"),
// parser: require.resolve("@babel/eslint-parser"),
// parserOptions: { requireConfigFile: false },
});

const typescriptRuleTester = new RuleTester({
Expand Down

0 comments on commit c3f23be

Please sign in to comment.