eslint-plugin-crisp 1.6.0 → 1.6.1
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
|
|
|
@@ -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
|
});
|