@the-stranger/eslint-plugin 2.0.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/LICENSE +21 -0
- package/README.md +29 -0
- package/package.json +100 -0
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +2 -0
- package/src/lib/configs/index.d.ts +17 -0
- package/src/lib/configs/index.d.ts.map +1 -0
- package/src/lib/configs/index.js +26 -0
- package/src/lib/configs/jest.d.ts +4 -0
- package/src/lib/configs/jest.d.ts.map +1 -0
- package/src/lib/configs/jest.js +27 -0
- package/src/lib/configs/jsdoc.d.ts +5 -0
- package/src/lib/configs/jsdoc.d.ts.map +1 -0
- package/src/lib/configs/jsdoc.js +44 -0
- package/src/lib/configs/jsonc.d.ts +4 -0
- package/src/lib/configs/jsonc.d.ts.map +1 -0
- package/src/lib/configs/jsonc.js +128 -0
- package/src/lib/configs/n.d.ts +4 -0
- package/src/lib/configs/n.d.ts.map +1 -0
- package/src/lib/configs/n.js +24 -0
- package/src/lib/configs/nx.d.ts +6 -0
- package/src/lib/configs/nx.d.ts.map +1 -0
- package/src/lib/configs/nx.js +45 -0
- package/src/lib/configs/perfectionist.d.ts +4 -0
- package/src/lib/configs/perfectionist.d.ts.map +1 -0
- package/src/lib/configs/perfectionist.js +129 -0
- package/src/lib/configs/promise.d.ts +4 -0
- package/src/lib/configs/promise.d.ts.map +1 -0
- package/src/lib/configs/promise.js +16 -0
- package/src/lib/configs/regexp.d.ts +4 -0
- package/src/lib/configs/regexp.d.ts.map +1 -0
- package/src/lib/configs/regexp.js +5 -0
- package/src/lib/configs/toml.d.ts +4 -0
- package/src/lib/configs/toml.d.ts.map +1 -0
- package/src/lib/configs/toml.js +35 -0
- package/src/lib/configs/typescript-eslint.d.ts +4 -0
- package/src/lib/configs/typescript-eslint.d.ts.map +1 -0
- package/src/lib/configs/typescript-eslint.js +26 -0
- package/src/lib/configs/unicorn.d.ts +4 -0
- package/src/lib/configs/unicorn.d.ts.map +1 -0
- package/src/lib/configs/unicorn.js +66 -0
- package/src/lib/configs/vitest.d.ts +4 -0
- package/src/lib/configs/vitest.d.ts.map +1 -0
- package/src/lib/configs/vitest.js +15 -0
- package/src/lib/configs/yml.d.ts +4 -0
- package/src/lib/configs/yml.d.ts.map +1 -0
- package/src/lib/configs/yml.js +127 -0
- package/src/lib/extend-config.d.ts +3 -0
- package/src/lib/extend-config.d.ts.map +1 -0
- package/src/lib/extend-config.js +22 -0
- package/src/lib/meta.d.ts +3 -0
- package/src/lib/meta.d.ts.map +1 -0
- package/src/lib/meta.js +3 -0
- package/src/lib/namer.d.ts +24 -0
- package/src/lib/namer.d.ts.map +1 -0
- package/src/lib/namer.js +36 -0
- package/src/lib/patterns.d.ts +82 -0
- package/src/lib/patterns.d.ts.map +1 -0
- package/src/lib/patterns.js +147 -0
- package/src/lib/rule-levels.d.ts +43 -0
- package/src/lib/rule-levels.d.ts.map +1 -0
- package/src/lib/rule-levels.js +71 -0
- package/src/lib/severity.d.ts +13 -0
- package/src/lib/severity.d.ts.map +1 -0
- package/src/lib/severity.js +34 -0
- package/src/utils.d.ts +4 -0
- package/src/utils.d.ts.map +1 -0
- package/src/utils.js +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Chris Strange
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @the-stranger/eslint-plugin
|
|
2
|
+
|
|
3
|
+
ESLint plugin, which mostly consists of common configurations. It also includes a couple of ESLint configuration utilities.
|
|
4
|
+
|
|
5
|
+
## Configurations Provided
|
|
6
|
+
|
|
7
|
+
The configurations provided by this plugin include:
|
|
8
|
+
|
|
9
|
+
- **JSDoc**: Recommended configs from [eslint-plugin-jsdoc] for both TypeScript and JavaScript files, and allows the `@document` tag used by Docusaurus.
|
|
10
|
+
- **Node (n)**: Extends recommended config from [eslint-plugin-n].
|
|
11
|
+
- **Perfectionist**: Extends [eslint-plugin-perfectionist]; sorts ALL THE THINGS!
|
|
12
|
+
- **Promise**: Recommended rules from [eslint-plugin-promise].
|
|
13
|
+
- **Regexp**: Recommended rules from [eslint-plugin-regexp].
|
|
14
|
+
- **TypeScript ESLint**: Sets up linting for TypeScript using either [@nx/eslint-plugin] or [typescript-eslint], disabling some of the noisier ones
|
|
15
|
+
- **Unicorn**: Recommended rules from [eslint-plugin-unicorn] with a bunch of customizations.
|
|
16
|
+
- **YAML**: Recommended config from [eslint-plugin-yml], and adds key and array sorting. Uses [yaml-eslint-parser].
|
|
17
|
+
|
|
18
|
+
<!-- Links -->
|
|
19
|
+
|
|
20
|
+
[@nx/eslint-plugin]: https://nx.dev/docs/technologies/eslint/eslint-plugin/introduction
|
|
21
|
+
[eslint-plugin-jsdoc]: https://github.com/gajus/eslint-plugin-jsdoc
|
|
22
|
+
[eslint-plugin-n]: https://github.com/eslint-community/eslint-plugin-n
|
|
23
|
+
[eslint-plugin-perfectionist]: https://perfectionist.dev
|
|
24
|
+
[eslint-plugin-promise]: https://github.com/eslint-community/eslint-plugin-promise
|
|
25
|
+
[eslint-plugin-regexp]: https://ota-meshi.github.io/eslint-plugin-regexp
|
|
26
|
+
[eslint-plugin-unicorn]: https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
27
|
+
[eslint-plugin-yml]: https://ota-meshi.github.io/eslint-plugin-yml
|
|
28
|
+
[typescript-eslint]: https://typescript-eslint.io
|
|
29
|
+
[yaml-eslint-parser]: https://github.com/ota-meshi/yaml-eslint-parser
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@the-stranger/eslint-plugin",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"url": "https://github.com/the-chris-strange/the-stranger",
|
|
6
|
+
"directory": "packages/eslint-plugin"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./src/index.d.ts",
|
|
13
|
+
"import": "./src/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./utils": {
|
|
16
|
+
"types": "./src/utils.d.ts",
|
|
17
|
+
"import": "./src/utils.js"
|
|
18
|
+
},
|
|
19
|
+
"./configs/jest": {
|
|
20
|
+
"types": "./src/lib/configs/jest.d.ts",
|
|
21
|
+
"import": "./src/lib/configs/jest.js"
|
|
22
|
+
},
|
|
23
|
+
"./configs/nx": {
|
|
24
|
+
"types": "./src/lib/configs/nx.d.ts",
|
|
25
|
+
"import": "./src/lib/configs/nx.js"
|
|
26
|
+
},
|
|
27
|
+
"./configs/toml": {
|
|
28
|
+
"types": "./src/lib/configs/toml.d.ts",
|
|
29
|
+
"import": "./src/lib/configs/toml.js"
|
|
30
|
+
},
|
|
31
|
+
"./configs/vitest": {
|
|
32
|
+
"types": "./src/lib/configs/vitest.d.ts",
|
|
33
|
+
"import": "./src/lib/configs/vitest.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"eslint-plugin-jsdoc": "^50.8.0",
|
|
38
|
+
"eslint-plugin-jsonc": "^2.21.0",
|
|
39
|
+
"eslint-plugin-n": "^17.23.2",
|
|
40
|
+
"eslint-plugin-perfectionist": "^4.15.1",
|
|
41
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
42
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
43
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
44
|
+
"eslint-plugin-yml": "^1.19.1",
|
|
45
|
+
"jsonc-eslint-parser": "^2.4.2",
|
|
46
|
+
"tslib": "^2.8.1",
|
|
47
|
+
"typescript-eslint": "^8.53.1",
|
|
48
|
+
"yaml-eslint-parser": "^1.3.2"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@eslint/js": "^9.39.2",
|
|
52
|
+
"@nx/eslint": "21.6.4",
|
|
53
|
+
"@nx/eslint-plugin": "21.6.4",
|
|
54
|
+
"@nx/vite": "21.6.4",
|
|
55
|
+
"@types/node": "^24.10.9",
|
|
56
|
+
"@typescript-eslint/parser": "^8.53.1",
|
|
57
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
58
|
+
"@vitest/eslint-plugin": "^1.3.16",
|
|
59
|
+
"eslint": "^9.39.2",
|
|
60
|
+
"eslint-config-prettier": "^10.1.8",
|
|
61
|
+
"eslint-plugin-eslint-plugin": "^7.3.0",
|
|
62
|
+
"eslint-plugin-jest": "^29.12.1",
|
|
63
|
+
"eslint-plugin-toml": "^0.12.0",
|
|
64
|
+
"nx": "21.6.4",
|
|
65
|
+
"prettier": "^3.8.0",
|
|
66
|
+
"prettier-plugin-packagejson": "^2.5.22",
|
|
67
|
+
"toml-eslint-parser": "^0.10.1",
|
|
68
|
+
"typescript": "^5.9.3",
|
|
69
|
+
"vite": "7.3.1",
|
|
70
|
+
"vitest": "^3.2.4"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@nx/eslint-plugin": "21.6.4",
|
|
74
|
+
"@vitest/eslint-plugin": "^1.6.6",
|
|
75
|
+
"eslint": "^9",
|
|
76
|
+
"eslint-plugin-jest": "^29.12.1",
|
|
77
|
+
"eslint-plugin-toml": "^0.12.0",
|
|
78
|
+
"toml-eslint-parser": "^0.10.1"
|
|
79
|
+
},
|
|
80
|
+
"peerDependenciesMeta": {
|
|
81
|
+
"@nx/eslint-plugin": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
84
|
+
"@vitest/eslint-plugin": {
|
|
85
|
+
"optional": true
|
|
86
|
+
},
|
|
87
|
+
"eslint-plugin-jest": {
|
|
88
|
+
"optional": true
|
|
89
|
+
},
|
|
90
|
+
"eslint-plugin-toml": {
|
|
91
|
+
"optional": true
|
|
92
|
+
},
|
|
93
|
+
"toml-eslint-parser": {
|
|
94
|
+
"optional": true
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"engines": {
|
|
98
|
+
"node": "^24"
|
|
99
|
+
}
|
|
100
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/eslint-plugin/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA"}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
interface Configs {
|
|
3
|
+
base: Linter.Config[];
|
|
4
|
+
jsdoc: Linter.Config[];
|
|
5
|
+
jsonc: Linter.Config[];
|
|
6
|
+
n: Linter.Config[];
|
|
7
|
+
perfectionist: Linter.Config[];
|
|
8
|
+
promise: Linter.Config[];
|
|
9
|
+
recommended: Linter.Config[];
|
|
10
|
+
regexp: Linter.Config[];
|
|
11
|
+
ts: Linter.Config[];
|
|
12
|
+
unicorn: Linter.Config[];
|
|
13
|
+
yml: Linter.Config[];
|
|
14
|
+
}
|
|
15
|
+
export declare const configs: Configs;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint-plugin/src/lib/configs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAyBpC,UAAU,OAAO;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IACtB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IACtB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IAClB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IACxB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IACvB,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IACxB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;CACrB;AAED,eAAO,MAAM,OAAO,EAAE,OAIrB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { extendConfig } from '../extend-config.js';
|
|
2
|
+
import jsdoc from './jsdoc.js';
|
|
3
|
+
import jsonc from './jsonc.js';
|
|
4
|
+
import n from './n.js';
|
|
5
|
+
import perfectionist from './perfectionist.js';
|
|
6
|
+
import promise from './promise.js';
|
|
7
|
+
import regexp from './regexp.js';
|
|
8
|
+
import ts from './typescript-eslint.js';
|
|
9
|
+
import unicorn from './unicorn.js';
|
|
10
|
+
import yml from './yml.js';
|
|
11
|
+
const recommendedConfigs = {
|
|
12
|
+
jsdoc,
|
|
13
|
+
jsonc,
|
|
14
|
+
n,
|
|
15
|
+
perfectionist,
|
|
16
|
+
promise,
|
|
17
|
+
regexp,
|
|
18
|
+
ts,
|
|
19
|
+
unicorn,
|
|
20
|
+
yml,
|
|
21
|
+
};
|
|
22
|
+
export const configs = {
|
|
23
|
+
...recommendedConfigs,
|
|
24
|
+
base: extendConfig(),
|
|
25
|
+
recommended: extendConfig(...Object.values(recommendedConfigs)),
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint-plugin/src/lib/configs/jest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;wBA6B/B,MAAM,CAAC,MAAM,EAAE;AAxBpB,wBAwBoB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import jest from 'eslint-plugin-jest';
|
|
2
|
+
import { namer } from '../namer.js';
|
|
3
|
+
import { FilePatterns, getFilePatterns } from '../patterns.js';
|
|
4
|
+
export default [
|
|
5
|
+
jest.configs['flat/recommended'],
|
|
6
|
+
jest.configs['flat/style'],
|
|
7
|
+
{
|
|
8
|
+
files: getFilePatterns(FilePatterns.test),
|
|
9
|
+
name: namer('jest'),
|
|
10
|
+
rules: {
|
|
11
|
+
'jest/consistent-test-it': ['error', { fn: 'it' }],
|
|
12
|
+
'jest/no-confusing-set-timeout': 'error',
|
|
13
|
+
'jest/prefer-each': 'warn',
|
|
14
|
+
'jest/prefer-equality-matcher': 'error',
|
|
15
|
+
'jest/prefer-expect-resolves': 'warn',
|
|
16
|
+
'jest/prefer-hooks-in-order': 'error',
|
|
17
|
+
'jest/prefer-hooks-on-top': 'warn',
|
|
18
|
+
'jest/prefer-importing-jest-globals': 'error',
|
|
19
|
+
'jest/prefer-jest-mocked': 'warn',
|
|
20
|
+
'jest/prefer-lowercase-title': 'warn',
|
|
21
|
+
'jest/prefer-mock-promise-shorthand': 'warn',
|
|
22
|
+
'jest/prefer-spy-on': 'warn',
|
|
23
|
+
'jest/prefer-strict-equal': 'warn',
|
|
24
|
+
'jest/valid-title': ['warn', { disallowedWords: ['should'] }],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsdoc.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint-plugin/src/lib/configs/jsdoc.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAMpC,eAAO,MAAM,eAAe,UAAe,CAAA;wBA2CtC,MAAM,CAAC,MAAM,EAAE;AAzCpB,wBAyCoB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import jsdoc from 'eslint-plugin-jsdoc';
|
|
2
|
+
import { namer } from '../namer.js';
|
|
3
|
+
import { FilePatterns, getFilePatterns } from '../patterns.js';
|
|
4
|
+
// tags used by docusaurus to generate docs from jsdoc comments
|
|
5
|
+
export const DOCUSAURUS_TAGS = ['document'];
|
|
6
|
+
export default [
|
|
7
|
+
{
|
|
8
|
+
name: namer('jsdoc'),
|
|
9
|
+
plugins: { jsdoc },
|
|
10
|
+
rules: {
|
|
11
|
+
'jsdoc/require-jsdoc': 'off',
|
|
12
|
+
'jsdoc/require-returns': [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
checkGetters: false,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
settings: {
|
|
20
|
+
jsdoc: {
|
|
21
|
+
tagNamePreference: {
|
|
22
|
+
augments: 'extends',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
extends: [jsdoc.configs['flat/recommended-typescript']],
|
|
29
|
+
files: getFilePatterns(FilePatterns.ts),
|
|
30
|
+
name: namer('jsdoc/typescript'),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
extends: [jsdoc.configs['flat/recommended']],
|
|
34
|
+
files: getFilePatterns(FilePatterns.js),
|
|
35
|
+
name: namer('jsdoc/javascript'),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
files: getFilePatterns(FilePatterns.source),
|
|
39
|
+
name: namer('jsdoc/docusaurus'),
|
|
40
|
+
rules: {
|
|
41
|
+
'jsdoc/check-tag-names': ['warn', { definedTags: DOCUSAURUS_TAGS }],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint-plugin/src/lib/configs/jsonc.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;wBAwI/B,MAAM,CAAC,MAAM,EAAE;AApIpB,wBAoIoB"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import jsonc from 'eslint-plugin-jsonc';
|
|
2
|
+
import { namer } from '../namer.js';
|
|
3
|
+
export default [
|
|
4
|
+
jsonc.configs['flat/base'],
|
|
5
|
+
{
|
|
6
|
+
files: ['.vscode/settings.json'],
|
|
7
|
+
name: namer('jsonc/vscode-settings'),
|
|
8
|
+
rules: {
|
|
9
|
+
'jsonc/sort-array-values': [
|
|
10
|
+
'warn',
|
|
11
|
+
{
|
|
12
|
+
order: { type: 'asc' },
|
|
13
|
+
pathPattern: String.raw `(eslint\.(probe|validate))|(npm\.exclude)`,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
'jsonc/sort-keys': ['warn', { order: { type: 'asc' }, pathPattern: '^' }],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
files: ['.vscode/extensions.json'],
|
|
21
|
+
name: namer('jsonc/vscode-extensions'),
|
|
22
|
+
rules: {
|
|
23
|
+
'jsonc/sort-array-values': [
|
|
24
|
+
'warn',
|
|
25
|
+
{ order: { type: 'asc' }, pathPattern: '^recommendations$' },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
files: ['.vscode/launch.json', '.vscode/tasks.json'],
|
|
31
|
+
name: namer('jsonc/vscode-launch-tasks'),
|
|
32
|
+
rules: {
|
|
33
|
+
'jsonc/sort-keys': [
|
|
34
|
+
'warn',
|
|
35
|
+
{ order: ['version', { order: { type: 'asc' } }], pathPattern: '^$' },
|
|
36
|
+
{
|
|
37
|
+
order: ['label', 'detail', 'command', 'args', { order: { type: 'asc' } }],
|
|
38
|
+
pathPattern: String.raw `^tasks\[\d+\]`,
|
|
39
|
+
},
|
|
40
|
+
{ order: { type: 'asc' }, pathPattern: '^' },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
files: ['nx.json'],
|
|
46
|
+
name: namer('jsonc/nx.json'),
|
|
47
|
+
rules: {
|
|
48
|
+
'jsonc/sort-keys': [
|
|
49
|
+
'warn',
|
|
50
|
+
{ order: { type: 'asc' }, pathPattern: '^plugins.+options' },
|
|
51
|
+
{ order: ['plugin', 'options'], pathPattern: '^plugins' },
|
|
52
|
+
{ order: { type: 'asc' }, pathPattern: '^' },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
files: ['executors.json', 'generators.json'],
|
|
58
|
+
name: namer('jsonc/nx-plugin files'),
|
|
59
|
+
rules: {
|
|
60
|
+
'jsonc/sort-keys': ['warn', { order: { type: 'asc' }, pathPattern: '^' }],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
files: ['project.json', '**/project.json'],
|
|
65
|
+
name: namer('jsonc/nx project.json'),
|
|
66
|
+
rules: {
|
|
67
|
+
'jsonc/sort-array-values': [
|
|
68
|
+
'warn',
|
|
69
|
+
{ order: { type: 'asc' }, pathPattern: '^tags' },
|
|
70
|
+
],
|
|
71
|
+
'jsonc/sort-keys': [
|
|
72
|
+
'warn',
|
|
73
|
+
{
|
|
74
|
+
order: [
|
|
75
|
+
'executor',
|
|
76
|
+
'inputs',
|
|
77
|
+
'outputs',
|
|
78
|
+
'options',
|
|
79
|
+
{ order: { type: 'asc' } },
|
|
80
|
+
],
|
|
81
|
+
pathPattern: 'targets.+',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
order: [
|
|
85
|
+
'name',
|
|
86
|
+
'$schema',
|
|
87
|
+
'projectType',
|
|
88
|
+
'sourceRoot',
|
|
89
|
+
'tags',
|
|
90
|
+
'targets',
|
|
91
|
+
{ order: { type: 'asc' } },
|
|
92
|
+
],
|
|
93
|
+
pathPattern: '^$',
|
|
94
|
+
},
|
|
95
|
+
{ order: { type: 'asc' }, pathPattern: '^' },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
files: ['tsconfig.json', 'tsconfig.*.json'],
|
|
101
|
+
name: namer('jsonc/tsconfig'),
|
|
102
|
+
rules: {
|
|
103
|
+
'jsonc/sort-keys': [
|
|
104
|
+
'warn',
|
|
105
|
+
{
|
|
106
|
+
order: [
|
|
107
|
+
'extends',
|
|
108
|
+
'compilerOptions',
|
|
109
|
+
'files',
|
|
110
|
+
'include',
|
|
111
|
+
'exclude',
|
|
112
|
+
'references',
|
|
113
|
+
{ order: { type: 'asc' } },
|
|
114
|
+
],
|
|
115
|
+
pathPattern: '^$',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
order: ['paths', { order: { type: 'asc' } }],
|
|
119
|
+
pathPattern: '^compilerOptions$',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
order: [{ order: { type: 'asc' } }],
|
|
123
|
+
pathPattern: String.raw `^compilerOptions\.paths$`,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint-plugin/src/lib/configs/n.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;wBAyB/B,MAAM,CAAC,MAAM,EAAE;AApBpB,wBAoBoB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import n from 'eslint-plugin-n';
|
|
2
|
+
import { namer } from '../namer.js';
|
|
3
|
+
import { FilePatterns, getFilePatterns } from '../patterns.js';
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
files: getFilePatterns(FilePatterns.source),
|
|
7
|
+
name: namer('n(ode)'),
|
|
8
|
+
plugins: { n },
|
|
9
|
+
rules: {
|
|
10
|
+
'n/exports-style': ['error', 'module.exports'],
|
|
11
|
+
'n/hashbang': 'error',
|
|
12
|
+
'n/no-deprecated-api': 'error',
|
|
13
|
+
'n/no-process-exit': 'error',
|
|
14
|
+
'n/prefer-global/buffer': ['error', 'always'],
|
|
15
|
+
'n/prefer-global/console': ['error', 'always'],
|
|
16
|
+
'n/prefer-global/process': ['error', 'always'],
|
|
17
|
+
'n/prefer-global/text-decoder': ['error', 'never'],
|
|
18
|
+
'n/prefer-global/text-encoder': ['error', 'never'],
|
|
19
|
+
'n/prefer-global/url': ['error', 'never'],
|
|
20
|
+
'n/prefer-global/url-search-params': ['error', 'never'],
|
|
21
|
+
'n/prefer-node-protocol': 'error',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint-plugin/src/lib/configs/nx.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,KAAK,KAAK,EAAS,MAAM,aAAa,CAAA;AAE/C,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAkBjD,CAAA;wBA0BI,MAAM,CAAC,MAAM,EAAE;AAxBpB,wBAwBoB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import nx from '@nx/eslint-plugin';
|
|
2
|
+
import { namer } from '../namer.js';
|
|
3
|
+
export const dependencyChecks = {
|
|
4
|
+
files: ['**/*.json'],
|
|
5
|
+
languageOptions: {
|
|
6
|
+
parser: await import('jsonc-eslint-parser'),
|
|
7
|
+
},
|
|
8
|
+
name: namer('nx-dependency-checks'),
|
|
9
|
+
rules: {
|
|
10
|
+
'@nx/dependency-checks': [
|
|
11
|
+
'error',
|
|
12
|
+
{
|
|
13
|
+
ignoredFiles: [
|
|
14
|
+
'{projectRoot}/eslint.config.{js,cjs,mjs}',
|
|
15
|
+
'{projectRoot}/vite.config.{js,ts,mjs,mts}',
|
|
16
|
+
'{projectRoot}/src/**/*.spec.{ts,js,mjs,mts,tsx,jsx}',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export default [
|
|
23
|
+
nx.configs['flat/base'],
|
|
24
|
+
nx.configs['flat/javascript'],
|
|
25
|
+
nx.configs['flat/typescript'],
|
|
26
|
+
{
|
|
27
|
+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
28
|
+
name: namer('nx-module-boundaries'),
|
|
29
|
+
rules: {
|
|
30
|
+
'@nx/enforce-module-boundaries': [
|
|
31
|
+
'error',
|
|
32
|
+
{
|
|
33
|
+
allow: [],
|
|
34
|
+
depConstraints: [
|
|
35
|
+
{
|
|
36
|
+
onlyDependOnLibsWithTags: ['*'],
|
|
37
|
+
sourceTag: '*',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
enforceBuildableLibDependency: true,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint-plugin/src/lib/configs/perfectionist.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;wBAqI/B,MAAM,CAAC,MAAM,EAAE;AA7HpB,wBA6HoB"}
|