eslint-plugin-crisp 1.0.70 → 1.0.71
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
|
@@ -6,10 +6,20 @@ module.exports = {
|
|
|
6
6
|
category: "Best Practices",
|
|
7
7
|
recommended: false,
|
|
8
8
|
},
|
|
9
|
+
schema: [
|
|
10
|
+
{
|
|
11
|
+
type: "object",
|
|
12
|
+
additionalProperties: {
|
|
13
|
+
type: "string",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
],
|
|
9
17
|
fixable: null, // This rule is not auto-fixable
|
|
10
18
|
},
|
|
11
19
|
|
|
12
20
|
create(context) {
|
|
21
|
+
const customGroups = context.options[0] || {}; // Get custom groups from options
|
|
22
|
+
|
|
13
23
|
let currentGroupComment = null;
|
|
14
24
|
|
|
15
25
|
// Extract the directory name from the file path
|
|
@@ -19,6 +29,13 @@ module.exports = {
|
|
|
19
29
|
}
|
|
20
30
|
|
|
21
31
|
function extractGroupFromPath(path, filePath) {
|
|
32
|
+
// Check custom regexes first
|
|
33
|
+
for (const regexStr in customGroups) {
|
|
34
|
+
if (new RegExp(regexStr).test(path)) {
|
|
35
|
+
return customGroups[regexStr];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
22
39
|
// Relative path import?
|
|
23
40
|
if (path.startsWith("./")) {
|
|
24
41
|
return getDirectoryName(filePath);
|