Skip to content

chore(CI): add tests for ESLint 8 #94

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

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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