eslint-plugin-crisp 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -221,20 +221,6 @@ export default {
|
|
|
221
221
|
break;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
case "ExportDefaultDeclaration": {
|
|
225
|
-
// Only enforce the 'EXPORTS' comment block if it's the last statement in the file
|
|
226
|
-
if (
|
|
227
|
-
startNode === sourceCode.ast.body.slice(-1)[0] &&
|
|
228
|
-
(!comment || `/*${comment.value.trim()}*/` !== COMMENT_HEADER_FORMAT("EXPORTS"))
|
|
229
|
-
) {
|
|
230
|
-
context.report({
|
|
231
|
-
node: startNode,
|
|
232
|
-
message: "Export group must be preceded by a 'EXPORTS' comment block",
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
break;
|
|
237
|
-
}
|
|
238
224
|
}
|
|
239
225
|
}
|
|
240
226
|
|
|
@@ -33,7 +33,9 @@ export default {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const tokenBefore = sourceCode.getTokenBefore(operatorToken);
|
|
36
|
-
const tokenAfter = sourceCode.getTokenAfter(operatorToken
|
|
36
|
+
const tokenAfter = sourceCode.getTokenAfter(operatorToken, {
|
|
37
|
+
includeComments: true
|
|
38
|
+
});
|
|
37
39
|
const beforeText = sourceCode.text.slice(
|
|
38
40
|
tokenBefore.range[1],
|
|
39
41
|
operatorToken.range[0]
|
|
@@ -24,6 +24,14 @@ ruleTester.run("header-comments-check", rule, {
|
|
|
24
24
|
`${header("TYPES")}\n/** @typedef {string} Identifier */\n\n` +
|
|
25
25
|
`${header("EXPORTS")}\nexport default {};`
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
filename: "/project/src/example.js",
|
|
29
|
+
code: "export default {};"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
filename: "/project/src/example.js",
|
|
33
|
+
code: `${header("MIXIN TO MANAGE HANDOFF")}\nexport default {};`
|
|
34
|
+
},
|
|
27
35
|
{
|
|
28
36
|
filename: "/project/src/example.js",
|
|
29
37
|
code:
|
|
@@ -76,15 +84,6 @@ ruleTester.run("header-comments-check", rule, {
|
|
|
76
84
|
message: "Type comments group must be preceded by a 'TYPES' comment block"
|
|
77
85
|
}
|
|
78
86
|
]
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
filename: "/project/src/example.js",
|
|
82
|
-
code: "export default {};",
|
|
83
|
-
errors: [
|
|
84
|
-
{
|
|
85
|
-
message: "Export group must be preceded by a 'EXPORTS' comment block"
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
87
|
}
|
|
89
88
|
]
|
|
90
89
|
});
|
|
@@ -7,6 +7,9 @@ ruleTester.run("one-space-after-operator", rule, {
|
|
|
7
7
|
valid: [
|
|
8
8
|
"let value = 1; value = 2;",
|
|
9
9
|
"let value = 1; value += 2;",
|
|
10
|
+
`let helpdeskLayout = /** @type {import("vue").ComputedRef<HelpdeskLayoutContext>} */ (
|
|
11
|
+
inject("helpdeskLayout")
|
|
12
|
+
);`,
|
|
10
13
|
"const object = { key : value };",
|
|
11
14
|
"const object = { method() {} };",
|
|
12
15
|
{
|
|
@@ -56,6 +59,15 @@ ruleTester.run("one-space-after-operator", rule, {
|
|
|
56
59
|
}
|
|
57
60
|
]
|
|
58
61
|
},
|
|
62
|
+
{
|
|
63
|
+
code: "const value =/** @type {number} */ (input);",
|
|
64
|
+
output: "const value = /** @type {number} */ (input);",
|
|
65
|
+
errors: [
|
|
66
|
+
{
|
|
67
|
+
message: "There should be at least one space before and exactly one space after '='"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
59
71
|
{
|
|
60
72
|
code: "const object = { key: value };",
|
|
61
73
|
output: "const object = { key : value };",
|