Skip to content

Commit 9d7b18f

Browse files
committed
chore: fix ESLint errors
1 parent 1beb9cf commit 9d7b18f

15 files changed

+53
-70
lines changed

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: [],

lib/rules/no-use-ignored-vars.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ module.exports = {
2020
description: "disallow a use of ignored variables.",
2121
category: "Stylistic Issues",
2222
recommended: false,
23-
url:
24-
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-use-ignored-vars.md",
23+
url: "https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-use-ignored-vars.md",
2524
},
2625
fixable: null,
2726
schema: [{ type: "string" }],

lib/rules/no-useless-rest-spread.js

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

11-
const FUNC_TYPE = /^(?:FunctionDeclaration|(?:New|Call|(?:Arrow)?Function)Expression)$/u
11+
const FUNC_TYPE =
12+
/^(?:FunctionDeclaration|(?:New|Call|(?:Arrow)?Function)Expression)$/u
1213
const PROPERTY_PATTERN = /^(?:Experimental)?(Rest|Spread)Property$/u
1314

1415
/**
@@ -56,7 +57,7 @@ function getLastElementToken(sourceCode, node) {
5657
* @returns {function} A fixer function.
5758
*/
5859
function defineFixer(sourceCode, node) {
59-
return fixer => {
60+
return (fixer) => {
6061
const child = node.argument
6162

6263
// If the inner array includes holes, do nothing.
@@ -97,8 +98,7 @@ module.exports = {
9798
description: "disallow unnecessary spread operators.",
9899
category: "Best Practices",
99100
recommended: false,
100-
url:
101-
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-useless-rest-spread.md",
101+
url: "https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-useless-rest-spread.md",
102102
},
103103
fixable: "code",
104104
schema: [],
@@ -116,7 +116,7 @@ module.exports = {
116116
function verify(node) {
117117
const nodeType = node.type.replace(
118118
PROPERTY_PATTERN,
119-
t => `${t}Element`
119+
(t) => `${t}Element`
120120
)
121121
const parentType = node.parent.type
122122
const argumentType = node.argument.type

lib/rules/prefer-for-of.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function isIndexVarOnlyUsedToGetArrayElements(context, node) {
243243
const arrayText = getArrayTextOfForStatement(sourceCode, node)
244244
const indexVar = context.getDeclaredVariables(node.init)[0]
245245

246-
return indexVar.references.every(reference => {
246+
return indexVar.references.every((reference) => {
247247
const id = reference.identifier
248248

249249
return (
@@ -273,7 +273,8 @@ function isLengthVarOnlyUsedToTest(context, node) {
273273
const lengthVar = context.getDeclaredVariables(node.init.declarations[1])[0]
274274

275275
return lengthVar.references.every(
276-
reference => reference.init || contains(node.test, reference.identifier)
276+
(reference) =>
277+
reference.init || contains(node.test, reference.identifier)
277278
)
278279
}
279280

@@ -497,8 +498,7 @@ module.exports = {
497498
description: "requires for-of statements instead of Array#forEach",
498499
category: "Best Practices",
499500
recommended: false,
500-
url:
501-
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/prefer-for-of.md",
501+
url: "https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/prefer-for-of.md",
502502
},
503503
fixable: "code",
504504
schema: [],
@@ -580,7 +580,7 @@ module.exports = {
580580
if (
581581
thisFuncInfo != null &&
582582
thisFuncInfo.isTarget &&
583-
!thisFuncInfo.returnNodes.some(returnNode =>
583+
!thisFuncInfo.returnNodes.some((returnNode) =>
584584
contains(returnNode, node)
585585
)
586586
) {

0 commit comments

Comments
 (0)