Skip to content

Commit 43cd406

Browse files
committed
feat: support ESLint 8.x
BREAKING CHANGE: Requires Node@^12.22.0 || ^14.17.0 || >=16.0.0 BREAKING CHANGE: Requires ESLint@^8.0.0
1 parent f9c4c6b commit 43cd406

20 files changed

+84
-105
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest]
16-
eslint: [7]
16+
eslint: [8]
1717
node: [16]
1818
include:
1919
# On other platforms
@@ -26,10 +26,8 @@ jobs:
2626
os: ubuntu-latest
2727
- node: 12
2828
os: ubuntu-latest
29-
- node: 10
30-
os: ubuntu-latest
3129
# On the minimum supported ESLint/Node.js version
32-
- node: 10.12.0
30+
- node: 12.22.0
3331
os: ubuntu-latest
3432

3533
runs-on: ${{ matrix.os }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ npm install --save-dev eslint @mysticatea/eslint-plugin
1616

1717
### Requirements
1818

19-
- Node.js `^10.12.0 || >=12.0.0` or newer versions.
20-
- ESLint `^7.0.0` or newer versions.
19+
- Node.js `^12.22.0 || ^14.17.0 || >=16.0.0` or newer versions.
20+
- ESLint `^8.0.0` or newer versions.
2121

2222
## 📖 Usage
2323

lib/configs/_override-vue.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ module.exports = {
7777
"error",
7878
{
7979
singleline: 3,
80-
multiline: {
81-
max: 1,
82-
allowFirstLine: false,
83-
},
80+
multiline: 1,
8481
},
8582
],
8683
"@mysticatea/vue/max-len": ["error", { tabWidth: 4 }],

lib/processors/vue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
}
2323

2424
// Filter messages which are in disabled area.
25-
return messages[0].filter(message => {
25+
return messages[0].filter((message) => {
2626
if (message.ruleId === "@mysticatea/vue/comment-directive") {
2727
const rules = message.message.split(" ")
2828
const type = rules.shift()

lib/rules/arrow-parens.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ module.exports = {
3030
description: "enforce the parentheses style of arrow functions.",
3131
category: "Stylistic Issues",
3232
recommended: false,
33-
url:
34-
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/arrow-parens.md",
33+
url: "https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/arrow-parens.md",
3534
},
3635
fixable: "code",
3736
schema: [],

lib/rules/block-scoped-var.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
// Helpers
1010
//------------------------------------------------------------------------------
1111

12-
const scopeNodeType = /^(?:(?:Block|Switch|For(?:In|Of)?)Statement|CatchClause|Program)$/u
13-
const containerNodeType = /^(?:For(?:In|Of)?Statement|(?:Arrow)?Function(?:Declaration|Expression))$/u
12+
const scopeNodeType =
13+
/^(?:(?:Block|Switch|For(?:In|Of)?)Statement|CatchClause|Program)$/u
14+
const containerNodeType =
15+
/^(?:For(?:In|Of)?Statement|(?:Arrow)?Function(?:Declaration|Expression))$/u
1416

1517
/**
1618
* Checks whether or not a given definition should be skipped.
@@ -196,8 +198,7 @@ module.exports = {
196198
description: "disallow illegal usage of variables as block-scoped.",
197199
category: "Possible Errors",
198200
recommended: false,
199-
url:
200-
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/block-scoped-var.md",
201+
url: "https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/block-scoped-var.md",
201202
},
202203
fixable: null,
203204
schema: [],

lib/rules/no-instanceof-array.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ module.exports = {
1414
docs: {
1515
description: "disallow 'instanceof' for Array",
1616
category: "Best Practices",
17-
url:
18-
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-instanceof-array.md",
17+
url: "https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-instanceof-array.md",
1918
},
2019
fixable: "code",
2120
schema: [],
@@ -64,7 +63,7 @@ module.exports = {
6463
loc: node.loc,
6564
message:
6665
"Unexpected 'instanceof' operator. Use 'Array.isArray' instead.",
67-
fix: fixer =>
66+
fix: (fixer) =>
6867
fixer.replaceText(
6968
node,
7069
`Array.isArray(${sourceCode.getText(

lib/rules/no-instanceof-wrapper.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ module.exports = {
1414
docs: {
1515
description: "disallow 'instanceof' for wrapper objects",
1616
category: "Best Practices",
17-
url:
18-
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-instanceof-wrapper.md",
17+
url: "https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-instanceof-wrapper.md",
1918
},
2019
fixable: "code",
2120
schema: [],
@@ -76,7 +75,7 @@ module.exports = {
7675
message:
7776
"Unexpected 'instanceof' operator. Use 'typeof x === \"{{typeName}}\"' instead.",
7877
data: { typeName },
79-
fix: fixer =>
78+
fix: (fixer) =>
8079
fixer.replaceText(
8180
node,
8281
`typeof ${sourceCode.getText(

lib/rules/no-literal-call.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
//------------------------------------------------------------------------------
1010

1111
const LITERAL_TYPE = /^(?:(?:Array|Object)Expression|(?:Template)?Literal)$/u
12-
const LITERAL_AND_CLASS_TYPE = /^(?:(?:Array|Class|Object)Expression|(?:Template)?Literal)$/u
12+
const LITERAL_AND_CLASS_TYPE =
13+
/^(?:(?:Array|Class|Object)Expression|(?:Template)?Literal)$/u
1314

1415
//------------------------------------------------------------------------------
1516
// Rule Definition
@@ -21,8 +22,7 @@ module.exports = {
2122
description: "disallow a call of a literal.",
2223
category: "Possible Errors",
2324
recommended: false,
24-
url:
25-
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-literal-call.md",
25+
url: "https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-literal-call.md",
2626
},
2727
fixable: null,
2828
schema: [],

lib/rules/no-this-in-static.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ module.exports = {
1414
docs: {
1515
description: "disallow `this`/`super` in static methods",
1616
category: "Best Practices",
17-
url:
18-
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-this-in-static.md",
17+
url: "https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-this-in-static.md",
1918
},
2019
fixable: null,
2120
schema: [],

0 commit comments

Comments
 (0)