@darksheep/eslint 6.0.0 → 6.1.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/CHANGELOG.md +17 -0
- package/package.json +6 -6
- package/src/custom-logger/index.js +84 -0
- package/src/plugins/sca.js +7 -1
- package/types/src/custom-logger/index.d.ts +2 -0
- /package/src/{custom → custom-rules}/index.js +0 -0
- /package/src/{custom → custom-rules}/instance-of-array.js +0 -0
- /package/src/{custom → custom-rules}/loose-types.js +0 -0
- /package/src/{custom → custom-rules}/no-useless-expression.js +0 -0
- /package/src/{custom → custom-rules}/sequence-expression.js +0 -0
- /package/types/src/{custom → custom-rules}/index.d.ts +0 -0
- /package/types/src/{custom → custom-rules}/instance-of-array.d.ts +0 -0
- /package/types/src/{custom → custom-rules}/loose-types.d.ts +0 -0
- /package/types/src/{custom → custom-rules}/no-useless-expression.d.ts +0 -0
- /package/types/src/{custom → custom-rules}/sequence-expression.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [6.1.1](https://github.com/DarkSheepSoftware/eslint/compare/v6.1.0...v6.1.1) (2024-09-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 📦 Dependencies
|
|
7
|
+
|
|
8
|
+
* **pkg:** update dependency @stylistic/eslint-plugin to v2.7.1 ([#603](https://github.com/DarkSheepSoftware/eslint/issues/603)) ([ad9d995](https://github.com/DarkSheepSoftware/eslint/commit/ad9d9954ddf74c043e3201e75ca2b373368cd6e8))
|
|
9
|
+
* **pkg:** update dependency @stylistic/eslint-plugin to v2.7.2 ([#605](https://github.com/DarkSheepSoftware/eslint/issues/605)) ([fd6f353](https://github.com/DarkSheepSoftware/eslint/commit/fd6f353fab8566b35d1fb7f574279e1a6607a5d5))
|
|
10
|
+
* **pkg:** update dependency eslint-plugin-react to v7.35.1 ([#609](https://github.com/DarkSheepSoftware/eslint/issues/609)) ([bfe180c](https://github.com/DarkSheepSoftware/eslint/commit/bfe180cace2946640ff3e27a3a1b72638c8a8915))
|
|
11
|
+
* **pkg:** update typescript-eslint monorepo to v8.4.0 ([#608](https://github.com/DarkSheepSoftware/eslint/issues/608)) ([12cec2f](https://github.com/DarkSheepSoftware/eslint/commit/12cec2ff0a08d1d6d6a55b7106e5d1538165d2c6))
|
|
12
|
+
|
|
13
|
+
## [6.1.0](https://github.com/DarkSheepSoftware/eslint/compare/v6.0.0...v6.1.0) (2024-08-28)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### 🌟 Features
|
|
17
|
+
|
|
18
|
+
* Add linting logger ([#601](https://github.com/DarkSheepSoftware/eslint/issues/601)) ([2f7cce3](https://github.com/DarkSheepSoftware/eslint/commit/2f7cce3974ef1d02145a4200b6152fed9577c747))
|
|
19
|
+
|
|
3
20
|
## [6.0.0](https://github.com/DarkSheepSoftware/eslint/compare/v5.3.5...v6.0.0) (2024-08-28)
|
|
4
21
|
|
|
5
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darksheep/eslint",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/DarkSheepSoftware/eslint"
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@eslint-community/eslint-plugin-eslint-comments": "4.4.0",
|
|
25
25
|
"@eslint/eslintrc": "3.1.0",
|
|
26
26
|
"@eslint/js": "9.9.1",
|
|
27
|
-
"@stylistic/eslint-plugin": "2.
|
|
28
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
29
|
-
"@typescript-eslint/parser": "8.
|
|
27
|
+
"@stylistic/eslint-plugin": "2.7.2",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "8.4.0",
|
|
29
|
+
"@typescript-eslint/parser": "8.4.0",
|
|
30
30
|
"editorconfig": "2.0.0",
|
|
31
31
|
"eslint-plugin-jsdoc": "50.2.2",
|
|
32
32
|
"eslint-plugin-jsonc": "2.16.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"eslint-plugin-package-json": "0.15.2",
|
|
35
35
|
"eslint-plugin-perfectionist": "3.3.0",
|
|
36
36
|
"eslint-plugin-promise": "7.1.0",
|
|
37
|
-
"eslint-plugin-react": "7.35.
|
|
37
|
+
"eslint-plugin-react": "7.35.1",
|
|
38
38
|
"eslint-plugin-regexp": "2.6.0",
|
|
39
39
|
"eslint-plugin-security": "3.0.1",
|
|
40
40
|
"eslint-plugin-unicorn": "55.0.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"node": "^20 || ^21 || ^22"
|
|
68
68
|
},
|
|
69
69
|
"volta": {
|
|
70
|
-
"node": "22.
|
|
70
|
+
"node": "22.8.0",
|
|
71
71
|
"yarn": "4.4.1"
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import('eslint').Linter.LintMessage[][]} files some messages
|
|
3
|
+
* @returns {number}
|
|
4
|
+
*/
|
|
5
|
+
function getSeverity(files) {
|
|
6
|
+
let severity = -1;
|
|
7
|
+
for (const messages of files) {
|
|
8
|
+
for (const message of messages) {
|
|
9
|
+
if ('suppressions' in message) {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (message.severity > severity) {
|
|
14
|
+
({ severity } = message);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (severity === 2) {
|
|
18
|
+
return severity;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return severity;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** @type {(key: string) => boolean} */
|
|
27
|
+
const toBoolean = (key) => (
|
|
28
|
+
// eslint-disable-next-line n/no-process-env
|
|
29
|
+
process.env[key] == null ? false : process.env[key] !== 'false'
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
function isInEditor() {
|
|
33
|
+
return (
|
|
34
|
+
toBoolean('ATOM_HOME') ||
|
|
35
|
+
toBoolean('VSCODE_PID') ||
|
|
36
|
+
toBoolean('VSCODE_CWD') ||
|
|
37
|
+
toBoolean('JETBRAINS_IDE') ||
|
|
38
|
+
toBoolean('VIM') ||
|
|
39
|
+
toBoolean('NVIM')
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const icons = [
|
|
44
|
+
// green tick
|
|
45
|
+
'\u001B[32m\u{2713}\u001B[0m',
|
|
46
|
+
// blue info circle
|
|
47
|
+
'\u001B[34m\u{1F6C8}\u001B[0m',
|
|
48
|
+
// yellow warning
|
|
49
|
+
'\u001B[33m\u{26A0}\u001B[0m',
|
|
50
|
+
// red cross mark
|
|
51
|
+
'\u001B[31m\u{274C}\u001B[0m',
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
/** @type {Set<string>} */
|
|
55
|
+
const files = new Set();
|
|
56
|
+
/** @type {import('eslint').ESLint.Plugin} */
|
|
57
|
+
export default {
|
|
58
|
+
processors: {
|
|
59
|
+
logger: {
|
|
60
|
+
supportsAutofix: true,
|
|
61
|
+
postprocess: (messages, filename) => {
|
|
62
|
+
if (
|
|
63
|
+
process.argv.includes('--quiet') ||
|
|
64
|
+
isInEditor() === true ||
|
|
65
|
+
process.stdout.isTTY !== true
|
|
66
|
+
) {
|
|
67
|
+
return messages.flat();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
process.stdout.write(files.has(filename) ? '\r' : '\n');
|
|
71
|
+
files.add(filename);
|
|
72
|
+
|
|
73
|
+
const severity = getSeverity(messages);
|
|
74
|
+
if (severity > 0) {
|
|
75
|
+
console.info(messages);
|
|
76
|
+
}
|
|
77
|
+
const icon = icons[severity + 1];
|
|
78
|
+
process.stdout.write(`${files.size} ${icon} ${filename}`.trim());
|
|
79
|
+
return messages.flat();
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
package/src/plugins/sca.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import logger from '../custom-logger/index.js';
|
|
2
|
+
import sca from '../custom-rules/index.js';
|
|
2
3
|
import {
|
|
3
4
|
getCommonFiles,
|
|
4
5
|
getModuleFiles,
|
|
@@ -39,5 +40,10 @@ export async function createEslintSCAConfig(root) {
|
|
|
39
40
|
'sca/sequence-expression': 'error',
|
|
40
41
|
},
|
|
41
42
|
},
|
|
43
|
+
{
|
|
44
|
+
name: 'sca/logger',
|
|
45
|
+
plugins: { logger },
|
|
46
|
+
processor: 'logger/logger',
|
|
47
|
+
},
|
|
42
48
|
];
|
|
43
49
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|