Skip to content

Commit 3ea88d1

Browse files
committed
feat!: support eslint v8 (#1)
* breaking: drop node < 12 * feat: support eslint v8 * drop support eslint < v7
1 parent a7a03c8 commit 3ea88d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+172
-203
lines changed

.eslintrc.js

Lines changed: 75 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,70 +4,79 @@
44
*/
55
"use strict"
66

7-
const version = require("./package.json").version
8-
7+
// the config does not support eslint v8 yet, just replaced it with a simple config,
8+
// to make the ci passing.
99
module.exports = {
10-
extends: ["plugin:@mysticatea/es2015", "plugin:@mysticatea/+eslint-plugin"],
11-
rules: {
12-
"@mysticatea/eslint-plugin/test-case-property-ordering": [
13-
"error",
14-
[
15-
"filename",
16-
"code",
17-
"output",
18-
"options",
19-
"parser",
20-
"parserOptions",
21-
"globals",
22-
"env",
23-
"errors",
24-
],
25-
],
26-
},
27-
overrides: [
28-
{
29-
files: ["**/rules/*.js"],
30-
rules: {
31-
"@mysticatea/eslint-plugin/require-meta-docs-url": [
32-
"error",
33-
{
34-
pattern: `https://github.com/mysticatea/eslint-plugin-node/blob/v${version}/docs/rules/{{name}}.md`,
35-
},
36-
],
37-
},
38-
},
39-
{
40-
files: ["**/rules/no-unsupported-features/*.js"],
41-
rules: {
42-
"@mysticatea/eslint-plugin/require-meta-docs-url": [
43-
"error",
44-
{
45-
pattern: `https://github.com/mysticatea/eslint-plugin-node/blob/v${version}/docs/rules/no-unsupported-features/{{name}}.md`,
46-
},
47-
],
48-
},
49-
},
50-
{
51-
files: ["**/rules/prefer-global/*.js"],
52-
rules: {
53-
"@mysticatea/eslint-plugin/require-meta-docs-url": [
54-
"error",
55-
{
56-
pattern: `https://github.com/mysticatea/eslint-plugin-node/blob/v${version}/docs/rules/prefer-global/{{name}}.md`,
57-
},
58-
],
59-
},
60-
},
61-
{
62-
files: ["**/rules/prefer-promises/*.js"],
63-
rules: {
64-
"@mysticatea/eslint-plugin/require-meta-docs-url": [
65-
"error",
66-
{
67-
pattern: `https://github.com/mysticatea/eslint-plugin-node/blob/v${version}/docs/rules/prefer-promises/{{name}}.md`,
68-
},
69-
],
70-
},
71-
},
72-
],
73-
}
10+
extends: ["eslint:recommended", "plugin:node/recommended", "plugin:eslint-plugin/recommended"],
11+
env: {
12+
mocha: true,
13+
}
14+
};
15+
16+
// const version = require("./package.json").version
17+
18+
// module.exports = {
19+
// extends: ["plugin:@mysticatea/es2015", "plugin:@mysticatea/+eslint-plugin"],
20+
// rules: {
21+
// "@mysticatea/eslint-plugin/test-case-property-ordering": [
22+
// "error",
23+
// [
24+
// "filename",
25+
// "code",
26+
// "output",
27+
// "options",
28+
// "parser",
29+
// "parserOptions",
30+
// "globals",
31+
// "env",
32+
// "errors",
33+
// ],
34+
// ],
35+
// },
36+
// overrides: [
37+
// {
38+
// files: ["**/rules/*.js"],
39+
// rules: {
40+
// "@mysticatea/eslint-plugin/require-meta-docs-url": [
41+
// "error",
42+
// {
43+
// pattern: `https://github.com/mysticatea/eslint-plugin-node/blob/v${version}/docs/rules/{{name}}.md`,
44+
// },
45+
// ],
46+
// },
47+
// },
48+
// {
49+
// files: ["**/rules/no-unsupported-features/*.js"],
50+
// rules: {
51+
// "@mysticatea/eslint-plugin/require-meta-docs-url": [
52+
// "error",
53+
// {
54+
// pattern: `https://github.com/mysticatea/eslint-plugin-node/blob/v${version}/docs/rules/no-unsupported-features/{{name}}.md`,
55+
// },
56+
// ],
57+
// },
58+
// },
59+
// {
60+
// files: ["**/rules/prefer-global/*.js"],
61+
// rules: {
62+
// "@mysticatea/eslint-plugin/require-meta-docs-url": [
63+
// "error",
64+
// {
65+
// pattern: `https://github.com/mysticatea/eslint-plugin-node/blob/v${version}/docs/rules/prefer-global/{{name}}.md`,
66+
// },
67+
// ],
68+
// },
69+
// },
70+
// {
71+
// files: ["**/rules/prefer-promises/*.js"],
72+
// rules: {
73+
// "@mysticatea/eslint-plugin/require-meta-docs-url": [
74+
// "error",
75+
// {
76+
// pattern: `https://github.com/mysticatea/eslint-plugin-node/blob/v${version}/docs/rules/prefer-promises/{{name}}.md`,
77+
// },
78+
// ],
79+
// },
80+
// },
81+
// ],
82+
// }

.github/workflows/CI.yml

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v1
16+
uses: actions/checkout@v2
1717
with:
1818
fetch-depth: 1
1919
- name: Install Node.js
20-
uses: actions/setup-node@v1
20+
uses: actions/setup-node@v2
2121
with:
22-
node: 12.x
22+
node: 16.x
2323
- name: Install Packages
2424
run: npm install
2525
- name: Lint
@@ -31,72 +31,28 @@ jobs:
3131
strategy:
3232
matrix:
3333
os: [ubuntu-latest, windows-latest, macOS-latest]
34-
eslint: [6.x, 5.x]
35-
node: [13.x, 12.x, 10.x, 8.x]
36-
exclude:
37-
# On Windows, run tests with only the latest LTS environments.
38-
- os: windows-latest
39-
eslint: 6.x
40-
node: 13.x
41-
- os: windows-latest
42-
eslint: 6.x
43-
node: 10.x
44-
- os: windows-latest
45-
eslint: 6.x
46-
node: 8.x
47-
- os: windows-latest
48-
eslint: 5.x
49-
node: 13.x
50-
- os: windows-latest
51-
eslint: 5.x
52-
node: 12.x
53-
- os: windows-latest
54-
eslint: 5.x
55-
node: 10.x
56-
- os: windows-latest
57-
eslint: 5.x
58-
node: 8.x
59-
# On macOS, run tests with only the latest LTS environments.
60-
- os: macOS-latest
61-
eslint: 6.x
62-
node: 13.x
63-
- os: macOS-latest
64-
eslint: 6.x
65-
node: 10.x
66-
- os: macOS-latest
67-
eslint: 6.x
68-
node: 8.x
69-
- os: macOS-latest
70-
eslint: 5.x
71-
node: 13.x
72-
- os: macOS-latest
73-
eslint: 5.x
74-
node: 12.x
75-
- os: macOS-latest
76-
eslint: 5.x
77-
node: 10.x
78-
- os: macOS-latest
79-
eslint: 5.x
80-
node: 8.x
81-
# Run ESLint 5.x tests on only the latest LTS Node.
34+
eslint: [8.x, 7.x]
35+
node: [16.x]
36+
include:
37+
# run on node lts(ubuntu-latest)
8238
- os: ubuntu-latest
83-
eslint: 5.x
84-
node: 13.x
39+
node: "12.x"
40+
eslint: "8.x"
8541
- os: ubuntu-latest
86-
eslint: 5.x
87-
node: 10.x
42+
node: "14.x"
43+
eslint: "8.x"
8844
- os: ubuntu-latest
89-
eslint: 5.x
90-
node: 8.x
45+
node: "17.x"
46+
eslint: "8.x"
9147

9248
runs-on: ${{ matrix.os }}
9349
steps:
9450
- name: Checkout
95-
uses: actions/checkout@v1
51+
uses: actions/checkout@v2
9652
with:
9753
fetch-depth: 1
9854
- name: Install Node.js ${{ matrix.node }}
99-
uses: actions/setup-node@v1
55+
uses: actions/setup-node@v2
10056
with:
10157
node-version: ${{ matrix.node }}
10258
- name: Install Packages

lib/rules/callback-return.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
category: "Stylistic Issues",
1313
recommended: false,
1414
url:
15-
"https://github.com/mysticatea/eslint-plugin-node/blob/v12.0.0/docs/rules/callback-return.md",
15+
"https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/callback-return.md",
1616
},
1717
schema: [
1818
{

lib/rules/exports-style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ module.exports = {
146146
category: "Stylistic Issues",
147147
recommended: false,
148148
url:
149-
"https://github.com/mysticatea/eslint-plugin-node/blob/v12.0.0/docs/rules/exports-style.md",
149+
"https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/exports-style.md",
150150
},
151151
type: "suggestion",
152152
fixable: null,

lib/rules/file-extension-in-import.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = {
3939
category: "Stylistic Issues",
4040
recommended: false,
4141
url:
42-
"https://github.com/mysticatea/eslint-plugin-node/blob/v12.0.0/docs/rules/file-extension-in-import.md",
42+
"https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/file-extension-in-import.md",
4343
},
4444
fixable: "code",
4545
messages: {

lib/rules/global-require.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = {
5656
category: "Stylistic Issues",
5757
recommended: false,
5858
url:
59-
"https://github.com/mysticatea/eslint-plugin-node/blob/v12.0.0/docs/rules/global-require.md",
59+
"https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/global-require.md",
6060
},
6161
fixable: null,
6262
schema: [],

lib/rules/handle-callback-err.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
category: "Possible Errors",
1313
recommended: false,
1414
url:
15-
"https://github.com/mysticatea/eslint-plugin-node/blob/v12.0.0/docs/rules/handle-callback-err.md",
15+
"https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/handle-callback-err.md",
1616
},
1717
fixable: null,
1818
schema: [

lib/rules/no-callback-literal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
category: "Possible Errors",
1313
recommended: false,
1414
url:
15-
"https://github.com/mysticatea/eslint-plugin-node/blob/v12.0.0/docs/rules/no-callback-literal.md",
15+
"https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/no-callback-literal.md",
1616
},
1717
type: "problem",
1818
fixable: null,

lib/rules/no-deprecated-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ module.exports = {
686686
category: "Best Practices",
687687
recommended: true,
688688
url:
689-
"https://github.com/mysticatea/eslint-plugin-node/blob/v12.0.0/docs/rules/no-deprecated-api.md",
689+
"https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/no-deprecated-api.md",
690690
},
691691
type: "problem",
692692
fixable: null,

lib/rules/no-exports-assign.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = {
4141
category: "Possible Errors",
4242
recommended: true,
4343
url:
44-
"https://github.com/mysticatea/eslint-plugin-node/blob/v12.0.0/docs/rules/no-exports-assign.md",
44+
"https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/no-exports-assign.md",
4545
},
4646
fixable: null,
4747
messages: {

0 commit comments

Comments
 (0)