ilib-lint 2.11.0 → 2.12.0
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ilib-lint",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"module": "./src/index.js",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
"micromatch": "^4.0.7",
|
|
72
72
|
"options-parser": "^0.4.0",
|
|
73
73
|
"xml-js": "^1.6.11",
|
|
74
|
-
"ilib-lint-common": "^3.4.0",
|
|
75
74
|
"ilib-common": "^1.1.6",
|
|
76
|
-
"ilib-
|
|
77
|
-
"ilib-tools-common": "^1.17.0"
|
|
75
|
+
"ilib-lint-common": "^3.4.0",
|
|
76
|
+
"ilib-tools-common": "^1.17.0",
|
|
77
|
+
"ilib-locale": "^1.2.4"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"coverage": "pnpm test -- --coverage",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* AnsiConsoleFormatter.js - Formats result output
|
|
3
3
|
*
|
|
4
|
-
* Copyright © 2022-
|
|
4
|
+
* Copyright © 2022-2025 JEDLSoft
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -56,9 +56,12 @@ class AnsiConsoleFormatter extends Formatter {
|
|
|
56
56
|
output += ` Source: ${result.source}\n`;
|
|
57
57
|
}
|
|
58
58
|
output += ` ${result.highlight}
|
|
59
|
-
Auto-fix: ${result.fix === undefined ? "unavailable" : result.fix.applied ? "\
|
|
59
|
+
Auto-fix: ${result.fix === undefined ? "unavailable" : result.fix.applied ? "\u001B[92mapplied\u001B[0m" : "\u001B[91mnot applied\u001B[0m"}
|
|
60
60
|
Rule (${result.rule.getName()}): ${result.rule.getDescription()}
|
|
61
61
|
`;
|
|
62
|
+
if (result.locale) {
|
|
63
|
+
output += ` Locale: ${result.locale}\n`;
|
|
64
|
+
}
|
|
62
65
|
|
|
63
66
|
// output ascii terminal escape sequences
|
|
64
67
|
output = output.replace(/<e\d><\/e\d>/g, "\u001B[91m␣\u001B[0m");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ConfigBasedFormatter.js - Formats result output
|
|
3
3
|
*
|
|
4
|
-
* Copyright © 2023-
|
|
4
|
+
* Copyright © 2023-2025 JEDLSoft
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -37,7 +37,8 @@ const resultFields = [
|
|
|
37
37
|
"description",
|
|
38
38
|
"source",
|
|
39
39
|
"highlight",
|
|
40
|
-
"id"
|
|
40
|
+
"id",
|
|
41
|
+
"locale"
|
|
41
42
|
];
|
|
42
43
|
|
|
43
44
|
/**
|
|
@@ -67,12 +67,21 @@ class JsonFormatter extends Formatter {
|
|
|
67
67
|
stats: {
|
|
68
68
|
},
|
|
69
69
|
results: results.map((result) => {
|
|
70
|
-
|
|
70
|
+
const obj = {
|
|
71
71
|
pathName: result.pathName,
|
|
72
72
|
rule: result.rule.getName(),
|
|
73
73
|
severity: result.severity,
|
|
74
74
|
locale: result.locale
|
|
75
75
|
};
|
|
76
|
+
if (result.fix) {
|
|
77
|
+
obj.fix = true;
|
|
78
|
+
obj.fixApplied = result.fix.applied;
|
|
79
|
+
} else {
|
|
80
|
+
obj.fix = false;
|
|
81
|
+
obj.fixApplied = false;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return obj;
|
|
76
85
|
})
|
|
77
86
|
};
|
|
78
87
|
|