@asd14/eslint-config 10.3.0 → 11.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 +1 -1
- package/README.md +24 -177
- package/dist/types/eslint.config.d.ts +172 -0
- package/dist/types/src/configs/dev-files.d.ts +14 -0
- package/dist/types/src/configs/node-jest.d.ts +17 -0
- package/dist/types/src/configs/node.d.ts +248 -0
- package/dist/types/src/configs/react-jest.d.ts +20 -0
- package/dist/types/src/configs/react.d.ts +1519 -0
- package/dist/types/src/configs/ts-node.d.ts +290 -0
- package/dist/types/src/index.d.ts +6 -0
- package/dist/types/src/rules/base.d.ts +16 -0
- package/dist/types/src/rules/import-dev.d.ts +9 -0
- package/dist/types/src/rules/import.d.ts +44 -0
- package/dist/types/src/rules/jsdoc.d.ts +40 -0
- package/dist/types/src/rules/nx-dev.d.ts +13 -0
- package/dist/types/src/rules/nx.d.ts +45 -0
- package/dist/types/src/rules/react.d.ts +120 -0
- package/dist/types/src/rules/rtl.d.ts +13 -0
- package/dist/types/src/rules/typescript.d.ts +53 -0
- package/dist/types/src/rules/unicorn.d.ts +42 -0
- package/dist/types/src/utils/find-up-sync.d.ts +34 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +51 -67
- package/src/configs/dev-files.js +17 -0
- package/src/configs/node-jest.js +29 -0
- package/src/configs/node.js +68 -0
- package/src/configs/react-jest.js +16 -0
- package/src/configs/react.js +89 -0
- package/src/configs/ts-node.js +23 -0
- package/src/index.js +6 -0
- package/src/rules/base.js +24 -0
- package/src/rules/import-dev.js +31 -0
- package/src/rules/import.js +55 -0
- package/src/rules/jsdoc.js +49 -0
- package/src/rules/nx-dev.js +23 -0
- package/src/rules/nx.js +81 -0
- package/{rules → src/rules}/react.js +41 -27
- package/src/rules/rtl.js +6 -0
- package/src/rules/typescript.js +88 -0
- package/{rules → src/rules}/unicorn.js +19 -41
- package/src/utils/find-up-sync.js +56 -0
- package/rules/best-practices.js +0 -11
- package/rules/comments.js +0 -46
- package/rules/errors.js +0 -112
- package/rules/es6.js +0 -48
- package/rules/html.js +0 -59
- package/rules/import-ts.js +0 -41
- package/rules/import.js +0 -101
- package/rules/jsdoc-ts.js +0 -8
- package/rules/jsdoc.js +0 -103
- package/rules/json.js +0 -9
- package/rules/node.js +0 -56
- package/rules/prettier.js +0 -16
- package/rules/promise.js +0 -68
- package/rules/style.js +0 -252
- package/rules/variables.js +0 -70
- package/targets/node-esm.js +0 -25
- package/targets/node-ts.js +0 -36
- package/targets/node.js +0 -36
- package/targets/react-ts.js +0 -94
- package/targets/react.js +0 -90
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,199 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
[](https://github.com/asd-xiv/eslint-config/actions/workflows/release.yml)
|
|
2
|
+
[](https://www.npmjs.com/package/@asd14/eslint-config)
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
[](https://badge.fury.io/js/%40asd14%2Feslint-config)
|
|
4
|
+
# @asd14/eslint-config
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
JavaScript ESLint bundle with best practices and common use rules for writing
|
|
9
|
-
more consistent code.
|
|
10
|
-
|
|
11
|
-
[`"semi": [ "error", "never" ]`](http://eslint.org/docs/rules/semi) :godmode:
|
|
12
|
-
...
|
|
13
|
-
[the horror](http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding)
|
|
14
|
-
:goberserk:
|
|
15
|
-
|
|
16
|
-
Other similar bundles: [XO](https://www.npmjs.com/package/xo),
|
|
17
|
-
[eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb),
|
|
18
|
-
[eslint-config-google](https://github.com/google/eslint-config-google),
|
|
19
|
-
[more](https://www.npmjs.com/search?q=+eslint-config-)
|
|
20
|
-
|
|
21
|
-
---
|
|
6
|
+
> ASD14's reusable ESLint configurations.
|
|
22
7
|
|
|
23
8
|
<!-- vim-markdown-toc GFM -->
|
|
24
9
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- [React](#react)
|
|
30
|
-
- [Inside](#inside)
|
|
31
|
-
- [Example config](#example-config)
|
|
32
|
-
- [Changelog](#changelog)
|
|
10
|
+
* [Installation](#installation)
|
|
11
|
+
* [Usage](#usage)
|
|
12
|
+
* [Peer dependencies](#peer-dependencies)
|
|
13
|
+
* [License](#license)
|
|
33
14
|
|
|
34
15
|
<!-- vim-markdown-toc -->
|
|
35
16
|
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npm install @asd14/eslint-config --save-dev
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Targets
|
|
43
|
-
|
|
44
|
-
Run `npm info "@asd14/eslint-config@latest" peerDependencies` to get the base
|
|
45
|
-
packages needed.
|
|
46
|
-
|
|
47
|
-
It should be something like:
|
|
48
|
-
|
|
49
|
-
```javascript
|
|
50
|
-
"eslint": "^8.13.0",
|
|
51
|
-
"prettier": "^2.6.0"
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Add these packages to your `devDependencies` in `package.json`.
|
|
55
|
-
|
|
56
|
-
### Node.js
|
|
57
|
-
|
|
58
|
-
Link ESLint to `node` target.
|
|
59
|
-
|
|
60
|
-
```javascript
|
|
61
|
-
// .eslintrc
|
|
62
|
-
{
|
|
63
|
-
"extends": [
|
|
64
|
-
"@asd14/eslint-config/targets/node",
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Node.js with Typescript
|
|
70
|
-
|
|
71
|
-
Link ESLint to `node-ts` target.
|
|
72
|
-
|
|
73
|
-
```javascript
|
|
74
|
-
// .eslintrc
|
|
75
|
-
{
|
|
76
|
-
"extends": [
|
|
77
|
-
"@asd14/eslint-config/targets/node-ts",
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
```
|
|
17
|
+
## Installation
|
|
81
18
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Link ESLint to `react` target.
|
|
85
|
-
|
|
86
|
-
```javascript
|
|
87
|
-
// .eslintrc
|
|
88
|
-
{
|
|
89
|
-
"extends": [
|
|
90
|
-
"@asd14/eslint-config/targets/react",
|
|
91
|
-
]
|
|
92
|
-
}
|
|
19
|
+
```sh
|
|
20
|
+
npm install --save-dev @asd14/ts-config eslint@^9 prettier@^3
|
|
93
21
|
```
|
|
94
22
|
|
|
95
|
-
##
|
|
96
|
-
|
|
97
|
-
- [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) - JSDoc
|
|
98
|
-
specific linting rules
|
|
99
|
-
- [eslint-plugin-import](https://www.npmjs.org/package/eslint-plugin-import) -
|
|
100
|
-
Support for ES2015+ (ES6+) import/export syntax
|
|
101
|
-
- [eslint-plugin-promise](https://www.npmjs.org/package/eslint-plugin-promise) -
|
|
102
|
-
Enforce best practices for JavaScript promises
|
|
103
|
-
- [eslint-plugin-unicorn](https://www.npmjs.org/package/eslint-plugin-unicorn) -
|
|
104
|
-
Various awesome ESLint rules
|
|
105
|
-
- [eslint-plugin-html](https://www.npmjs.org/package/eslint-plugin-html) -
|
|
106
|
-
Allows linting and fixing inline scripts contained in HTML files
|
|
107
|
-
- [eslint-plugin-react](https://www.npmjs.org/package/eslint-plugin-react) -
|
|
108
|
-
React specific linting rules
|
|
109
|
-
- [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks) -
|
|
110
|
-
Linting rules rules of React Hooks.
|
|
111
|
-
- [eslint-plugin-no-inferred-method-name](https://www.npmjs.org/package/eslint-plugin-no-inferred-method-name) -
|
|
112
|
-
In ES6, compact methods and unnamed function expression assignments within
|
|
113
|
-
object literals do not create a lexical identification (name) binding that
|
|
114
|
-
corresponds to the function name identifier for recursion or event binding.
|
|
115
|
-
The compact method syntax will not be an appropriate option for these types of
|
|
116
|
-
solutions, and a named function expression should be used instead. This custom
|
|
117
|
-
ESLint rule will identify instances where a function name is being called and
|
|
118
|
-
a lexical identifier is unavailable within a compact object literal.
|
|
119
|
-
- [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser) -
|
|
120
|
-
ESLint parser which leverages TypeScript ESTree to allow for ESLint to lint
|
|
121
|
-
TypeScript source code.
|
|
122
|
-
- [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin) -
|
|
123
|
-
ESLint plugin which provides lint rules for TypeScript codebases.
|
|
124
|
-
|
|
125
|
-
## Example config
|
|
23
|
+
## Usage
|
|
126
24
|
|
|
127
|
-
|
|
128
|
-
[`eslint-import-resolver-webpack`](https://www.npmjs.com/package/eslint-import-resolver-webpack)
|
|
25
|
+
In your `eslint.config.js`, extend the desired configuration:
|
|
129
26
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
```js
|
|
27
|
+
```json
|
|
133
28
|
{
|
|
134
|
-
|
|
135
|
-
"parser": "babel-eslint",
|
|
136
|
-
|
|
137
|
-
"extends": [ "@asd14/eslint-config/targets/react" ],
|
|
138
|
-
|
|
139
|
-
"settings": {
|
|
140
|
-
// Use webpack to resolve modules in imports
|
|
141
|
-
"import/resolver": {
|
|
142
|
-
"webpack": {
|
|
143
|
-
"config": "./webpack.config.js",
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
// Recommended if you use eslint_d
|
|
148
|
-
"import/cache": {
|
|
149
|
-
"lifetime": 5,
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
// List of regex strings that, if matched by a path, will not report
|
|
153
|
-
// the matching module if no exports are found.
|
|
154
|
-
"import/ignore": [ "\\.(sass|scss|less|css)$" ],
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
// Custom rules
|
|
158
|
-
"rules": {
|
|
159
|
-
},
|
|
160
|
-
}
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
`.prettierrc`
|
|
164
|
-
|
|
165
|
-
```js
|
|
166
|
-
{
|
|
167
|
-
"semi": false,
|
|
168
|
-
"printWidth": 80,
|
|
169
|
-
"tabWidth": 2,
|
|
170
|
-
"useTabs": false,
|
|
171
|
-
"singleQuote": false,
|
|
172
|
-
"trailingComma": "es5",
|
|
173
|
-
"bracketSpacing": true,
|
|
174
|
-
"bracketSameLine": true,
|
|
175
|
-
"arrowParens": "avoid"
|
|
29
|
+
"extends": "@asd14/ts-config/targets/react.json"
|
|
176
30
|
}
|
|
177
31
|
```
|
|
178
32
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
root = true
|
|
33
|
+
## Peer dependencies
|
|
183
34
|
|
|
184
|
-
|
|
185
|
-
charset = utf-8
|
|
186
|
-
indent_style = space
|
|
187
|
-
indent_size = 2
|
|
188
|
-
end_of_line = lf
|
|
189
|
-
trim_trailing_whitespace = true
|
|
190
|
-
insert_final_newline = true
|
|
35
|
+
This package requires and assumes you already installed:
|
|
191
36
|
|
|
192
|
-
|
|
193
|
-
|
|
37
|
+
```json
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"eslint": "^9",
|
|
40
|
+
"prettier": "^3"
|
|
41
|
+
},
|
|
194
42
|
```
|
|
195
43
|
|
|
196
|
-
##
|
|
44
|
+
## License
|
|
197
45
|
|
|
198
|
-
|
|
199
|
-
for details.
|
|
46
|
+
MIT
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let files: ["src/**/*.js", "types/*.d.ts", "eslint.config.js"];
|
|
3
|
+
let ignores: ["node_modules", "dist", "coverage"];
|
|
4
|
+
let languageOptions: {
|
|
5
|
+
readonly ecmaVersion: "latest";
|
|
6
|
+
readonly sourceType: "module";
|
|
7
|
+
readonly parserOptions: {
|
|
8
|
+
readonly projectService: true;
|
|
9
|
+
readonly ecmaVersion: "latest";
|
|
10
|
+
readonly tsconfigRootDir: string;
|
|
11
|
+
};
|
|
12
|
+
readonly globals: {
|
|
13
|
+
readonly __dirname: false;
|
|
14
|
+
readonly __filename: false;
|
|
15
|
+
readonly AbortController: false;
|
|
16
|
+
readonly AbortSignal: false;
|
|
17
|
+
readonly AsyncDisposableStack: false;
|
|
18
|
+
readonly atob: false;
|
|
19
|
+
readonly Blob: false;
|
|
20
|
+
readonly BroadcastChannel: false;
|
|
21
|
+
readonly btoa: false;
|
|
22
|
+
readonly Buffer: false;
|
|
23
|
+
readonly ByteLengthQueuingStrategy: false;
|
|
24
|
+
readonly clearImmediate: false;
|
|
25
|
+
readonly clearInterval: false;
|
|
26
|
+
readonly clearTimeout: false;
|
|
27
|
+
readonly CloseEvent: false;
|
|
28
|
+
readonly CompressionStream: false;
|
|
29
|
+
readonly console: false;
|
|
30
|
+
readonly CountQueuingStrategy: false;
|
|
31
|
+
readonly crypto: false;
|
|
32
|
+
readonly Crypto: false;
|
|
33
|
+
readonly CryptoKey: false;
|
|
34
|
+
readonly CustomEvent: false;
|
|
35
|
+
readonly DecompressionStream: false;
|
|
36
|
+
readonly DisposableStack: false;
|
|
37
|
+
readonly DOMException: false;
|
|
38
|
+
readonly Event: false;
|
|
39
|
+
readonly EventTarget: false;
|
|
40
|
+
readonly exports: true;
|
|
41
|
+
readonly fetch: false;
|
|
42
|
+
readonly File: false;
|
|
43
|
+
readonly FormData: false;
|
|
44
|
+
readonly global: false;
|
|
45
|
+
readonly Headers: false;
|
|
46
|
+
readonly MessageChannel: false;
|
|
47
|
+
readonly MessageEvent: false;
|
|
48
|
+
readonly MessagePort: false;
|
|
49
|
+
readonly module: false;
|
|
50
|
+
readonly navigator: false;
|
|
51
|
+
readonly Navigator: false;
|
|
52
|
+
readonly performance: false;
|
|
53
|
+
readonly Performance: false;
|
|
54
|
+
readonly PerformanceEntry: false;
|
|
55
|
+
readonly PerformanceMark: false;
|
|
56
|
+
readonly PerformanceMeasure: false;
|
|
57
|
+
readonly PerformanceObserver: false;
|
|
58
|
+
readonly PerformanceObserverEntryList: false;
|
|
59
|
+
readonly PerformanceResourceTiming: false;
|
|
60
|
+
readonly process: false;
|
|
61
|
+
readonly queueMicrotask: false;
|
|
62
|
+
readonly ReadableByteStreamController: false;
|
|
63
|
+
readonly ReadableStream: false;
|
|
64
|
+
readonly ReadableStreamBYOBReader: false;
|
|
65
|
+
readonly ReadableStreamBYOBRequest: false;
|
|
66
|
+
readonly ReadableStreamDefaultController: false;
|
|
67
|
+
readonly ReadableStreamDefaultReader: false;
|
|
68
|
+
readonly Request: false;
|
|
69
|
+
readonly require: false;
|
|
70
|
+
readonly Response: false;
|
|
71
|
+
readonly setImmediate: false;
|
|
72
|
+
readonly setInterval: false;
|
|
73
|
+
readonly setTimeout: false;
|
|
74
|
+
readonly structuredClone: false;
|
|
75
|
+
readonly SubtleCrypto: false;
|
|
76
|
+
readonly SuppressedError: false;
|
|
77
|
+
readonly TextDecoder: false;
|
|
78
|
+
readonly TextDecoderStream: false;
|
|
79
|
+
readonly TextEncoder: false;
|
|
80
|
+
readonly TextEncoderStream: false;
|
|
81
|
+
readonly TransformStream: false;
|
|
82
|
+
readonly TransformStreamDefaultController: false;
|
|
83
|
+
readonly URL: false;
|
|
84
|
+
readonly URLPattern: false;
|
|
85
|
+
readonly URLSearchParams: false;
|
|
86
|
+
readonly WebAssembly: false;
|
|
87
|
+
readonly WebSocket: false;
|
|
88
|
+
readonly WritableStream: false;
|
|
89
|
+
readonly WritableStreamDefaultController: false;
|
|
90
|
+
readonly WritableStreamDefaultWriter: false;
|
|
91
|
+
};
|
|
92
|
+
readonly parser: typeof import("@typescript-eslint/parser");
|
|
93
|
+
};
|
|
94
|
+
let plugins: {
|
|
95
|
+
readonly jsdoc: import("eslint").ESLint.Plugin & {
|
|
96
|
+
configs: Record<`flat/${import("eslint-plugin-jsdoc").ConfigGroups}${import("eslint-plugin-jsdoc").ConfigVariants}${import("eslint-plugin-jsdoc").ErrorLevelVariants}`, import("eslint").Linter.Config>;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
let rules: {
|
|
100
|
+
readonly "jsdoc/sort-tags": ["error", {
|
|
101
|
+
readonly reportIntraTagGroupSpacing: false;
|
|
102
|
+
readonly reportTagGroupSpacing: false;
|
|
103
|
+
}];
|
|
104
|
+
readonly "jsdoc/tag-lines": ["error", "always", {
|
|
105
|
+
readonly startLines: 1;
|
|
106
|
+
readonly endLines: 0;
|
|
107
|
+
readonly applyToEndTag: false;
|
|
108
|
+
readonly tags: {
|
|
109
|
+
readonly returns: {
|
|
110
|
+
readonly lines: "always";
|
|
111
|
+
};
|
|
112
|
+
readonly property: {
|
|
113
|
+
readonly lines: "any";
|
|
114
|
+
};
|
|
115
|
+
readonly param: {
|
|
116
|
+
readonly lines: "any";
|
|
117
|
+
};
|
|
118
|
+
readonly example: {
|
|
119
|
+
readonly lines: "always";
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
}];
|
|
123
|
+
readonly "jsdoc/check-indentation": "error";
|
|
124
|
+
readonly "jsdoc/check-alignment": "error";
|
|
125
|
+
readonly "jsdoc/no-bad-blocks": "error";
|
|
126
|
+
readonly "jsdoc/require-asterisk-prefix": ["error", "always"];
|
|
127
|
+
readonly "jsdoc/require-description": "off";
|
|
128
|
+
readonly "jsdoc/require-property-description": "off";
|
|
129
|
+
readonly "jsdoc/require-param-description": "off";
|
|
130
|
+
readonly "jsdoc/require-returns-description": "off";
|
|
131
|
+
readonly "unicorn/prefer-node-protocol": "error";
|
|
132
|
+
readonly "unicorn/no-array-for-each": "off";
|
|
133
|
+
readonly "unicorn/consistent-function-scoping": "off";
|
|
134
|
+
readonly "unicorn/better-regex": "error";
|
|
135
|
+
readonly "unicorn/catch-error-name": "error";
|
|
136
|
+
readonly "unicorn/expiring-todo-comments": "warn";
|
|
137
|
+
readonly "unicorn/no-process-exit": "error";
|
|
138
|
+
readonly "unicorn/no-fn-reference-in-iterator": "off";
|
|
139
|
+
readonly "unicorn/no-array-callback-reference": "off";
|
|
140
|
+
readonly "unicorn/import-index": "off";
|
|
141
|
+
readonly "unicorn/prefer-spread": "error";
|
|
142
|
+
readonly "unicorn/prefer-add-event-listener": "error";
|
|
143
|
+
readonly "unicorn/prefer-string-slice": "error";
|
|
144
|
+
readonly "unicorn/prefer-string-trim-start-end": "error";
|
|
145
|
+
readonly "unicorn/filename-case": "off";
|
|
146
|
+
readonly "unicorn/explicit-length-check": ["error", {
|
|
147
|
+
readonly "non-zero": "not-equal";
|
|
148
|
+
}];
|
|
149
|
+
readonly "unicorn/throw-new-error": "error";
|
|
150
|
+
readonly "unicorn/escape-case": "error";
|
|
151
|
+
readonly "unicorn/no-instanceof-array": "error";
|
|
152
|
+
readonly "unicorn/no-new-buffer": "error";
|
|
153
|
+
readonly "unicorn/no-hex-escape": "error";
|
|
154
|
+
readonly "unicorn/custom-error-definition": "error";
|
|
155
|
+
readonly "unicorn/prefer-type-error": "error";
|
|
156
|
+
readonly "unicorn/no-useless-undefined": "off";
|
|
157
|
+
readonly "unicorn/new-for-builtins": "error";
|
|
158
|
+
readonly "unicorn/error-message": "error";
|
|
159
|
+
readonly "no-restricted-exports": ["error", {
|
|
160
|
+
readonly restrictDefaultExports: {
|
|
161
|
+
readonly named: false;
|
|
162
|
+
readonly namedFrom: false;
|
|
163
|
+
};
|
|
164
|
+
}];
|
|
165
|
+
readonly "no-underscore-dangle": ["error", {
|
|
166
|
+
readonly allow: readonly ["_dirname", "_testResult"];
|
|
167
|
+
readonly allowInArrayDestructuring: true;
|
|
168
|
+
readonly allowInObjectDestructuring: true;
|
|
169
|
+
}];
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export namespace devFilesConfig {
|
|
2
|
+
let rules: {
|
|
3
|
+
readonly "@nx/enforce-module-boundaries": ["error", {
|
|
4
|
+
readonly allow: readonly [];
|
|
5
|
+
readonly depConstraints: readonly [{
|
|
6
|
+
readonly sourceTag: "*";
|
|
7
|
+
readonly onlyDependOnLibsWithTags: readonly ["type:lib"];
|
|
8
|
+
}];
|
|
9
|
+
}];
|
|
10
|
+
readonly "import/no-extraneous-dependencies": ["error", {
|
|
11
|
+
readonly packageDir: readonly ["./", string];
|
|
12
|
+
}];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export namespace nodeJestConfig {
|
|
2
|
+
let name: "ASD14's config for Node.js test files";
|
|
3
|
+
let languageOptions: import("eslint").Linter.LanguageOptions | undefined;
|
|
4
|
+
let plugins: Record<string, import("eslint").ESLint.Plugin> | undefined;
|
|
5
|
+
let rules: {
|
|
6
|
+
readonly "jest/require-top-level-describe": "error";
|
|
7
|
+
readonly "jest/consistent-test-it": ["error", {
|
|
8
|
+
readonly fn: "test";
|
|
9
|
+
readonly withinDescribe: "test";
|
|
10
|
+
}];
|
|
11
|
+
readonly "jest/valid-title": ["error", {
|
|
12
|
+
readonly mustMatch: {
|
|
13
|
+
readonly test: "^given \\[.*\\] should \\[.*\\]$";
|
|
14
|
+
};
|
|
15
|
+
}];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
export namespace nodeConfig {
|
|
2
|
+
let name: "ASD14 config for Node.js source files";
|
|
3
|
+
let ignores: ["node_modules", "dist", "coverage", "build"];
|
|
4
|
+
namespace languageOptions {
|
|
5
|
+
let ecmaVersion: "latest";
|
|
6
|
+
let sourceType: "module";
|
|
7
|
+
namespace parserOptions {
|
|
8
|
+
export let projectService: true;
|
|
9
|
+
let ecmaVersion_1: "latest";
|
|
10
|
+
export { ecmaVersion_1 as ecmaVersion };
|
|
11
|
+
}
|
|
12
|
+
let globals: {
|
|
13
|
+
readonly __dirname: false;
|
|
14
|
+
readonly __filename: false;
|
|
15
|
+
readonly AbortController: false;
|
|
16
|
+
readonly AbortSignal: false;
|
|
17
|
+
readonly AsyncDisposableStack: false;
|
|
18
|
+
readonly atob: false;
|
|
19
|
+
readonly Blob: false;
|
|
20
|
+
readonly BroadcastChannel: false;
|
|
21
|
+
readonly btoa: false;
|
|
22
|
+
readonly Buffer: false;
|
|
23
|
+
readonly ByteLengthQueuingStrategy: false;
|
|
24
|
+
readonly clearImmediate: false;
|
|
25
|
+
readonly clearInterval: false;
|
|
26
|
+
readonly clearTimeout: false;
|
|
27
|
+
readonly CloseEvent: false;
|
|
28
|
+
readonly CompressionStream: false;
|
|
29
|
+
readonly console: false;
|
|
30
|
+
readonly CountQueuingStrategy: false;
|
|
31
|
+
readonly crypto: false;
|
|
32
|
+
readonly Crypto: false;
|
|
33
|
+
readonly CryptoKey: false;
|
|
34
|
+
readonly CustomEvent: false;
|
|
35
|
+
readonly DecompressionStream: false;
|
|
36
|
+
readonly DisposableStack: false;
|
|
37
|
+
readonly DOMException: false;
|
|
38
|
+
readonly Event: false;
|
|
39
|
+
readonly EventTarget: false;
|
|
40
|
+
readonly exports: true;
|
|
41
|
+
readonly fetch: false;
|
|
42
|
+
readonly File: false;
|
|
43
|
+
readonly FormData: false;
|
|
44
|
+
readonly global: false;
|
|
45
|
+
readonly Headers: false;
|
|
46
|
+
readonly MessageChannel: false;
|
|
47
|
+
readonly MessageEvent: false;
|
|
48
|
+
readonly MessagePort: false;
|
|
49
|
+
readonly module: false;
|
|
50
|
+
readonly navigator: false;
|
|
51
|
+
readonly Navigator: false;
|
|
52
|
+
readonly performance: false;
|
|
53
|
+
readonly Performance: false;
|
|
54
|
+
readonly PerformanceEntry: false;
|
|
55
|
+
readonly PerformanceMark: false;
|
|
56
|
+
readonly PerformanceMeasure: false;
|
|
57
|
+
readonly PerformanceObserver: false;
|
|
58
|
+
readonly PerformanceObserverEntryList: false;
|
|
59
|
+
readonly PerformanceResourceTiming: false;
|
|
60
|
+
readonly process: false;
|
|
61
|
+
readonly queueMicrotask: false;
|
|
62
|
+
readonly ReadableByteStreamController: false;
|
|
63
|
+
readonly ReadableStream: false;
|
|
64
|
+
readonly ReadableStreamBYOBReader: false;
|
|
65
|
+
readonly ReadableStreamBYOBRequest: false;
|
|
66
|
+
readonly ReadableStreamDefaultController: false;
|
|
67
|
+
readonly ReadableStreamDefaultReader: false;
|
|
68
|
+
readonly Request: false;
|
|
69
|
+
readonly require: false;
|
|
70
|
+
readonly Response: false;
|
|
71
|
+
readonly setImmediate: false;
|
|
72
|
+
readonly setInterval: false;
|
|
73
|
+
readonly setTimeout: false;
|
|
74
|
+
readonly structuredClone: false;
|
|
75
|
+
readonly SubtleCrypto: false;
|
|
76
|
+
readonly SuppressedError: false;
|
|
77
|
+
readonly TextDecoder: false;
|
|
78
|
+
readonly TextDecoderStream: false;
|
|
79
|
+
readonly TextEncoder: false;
|
|
80
|
+
readonly TextEncoderStream: false;
|
|
81
|
+
readonly TransformStream: false;
|
|
82
|
+
readonly TransformStreamDefaultController: false;
|
|
83
|
+
readonly URL: false;
|
|
84
|
+
readonly URLPattern: false;
|
|
85
|
+
readonly URLSearchParams: false;
|
|
86
|
+
readonly WebAssembly: false;
|
|
87
|
+
readonly WebSocket: false;
|
|
88
|
+
readonly WritableStream: false;
|
|
89
|
+
readonly WritableStreamDefaultController: false;
|
|
90
|
+
readonly WritableStreamDefaultWriter: false;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
let plugins: {
|
|
94
|
+
readonly "@nx": Plugin;
|
|
95
|
+
readonly jsdoc: import("eslint").ESLint.Plugin & {
|
|
96
|
+
configs: Record<`flat/${import("eslint-plugin-jsdoc").ConfigGroups}${import("eslint-plugin-jsdoc").ConfigVariants}${import("eslint-plugin-jsdoc").ErrorLevelVariants}`, import("eslint").Linter.Config>;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
let rules: {
|
|
100
|
+
readonly "unicorn/prefer-node-protocol": "error";
|
|
101
|
+
readonly "unicorn/no-array-for-each": "off";
|
|
102
|
+
readonly "unicorn/consistent-function-scoping": "off";
|
|
103
|
+
readonly "unicorn/better-regex": "error";
|
|
104
|
+
readonly "unicorn/catch-error-name": "error";
|
|
105
|
+
readonly "unicorn/expiring-todo-comments": "warn";
|
|
106
|
+
readonly "unicorn/no-process-exit": "error";
|
|
107
|
+
readonly "unicorn/no-fn-reference-in-iterator": "off";
|
|
108
|
+
readonly "unicorn/no-array-callback-reference": "off";
|
|
109
|
+
readonly "unicorn/import-index": "off";
|
|
110
|
+
readonly "unicorn/prefer-spread": "error";
|
|
111
|
+
readonly "unicorn/prefer-add-event-listener": "error";
|
|
112
|
+
readonly "unicorn/prefer-string-slice": "error";
|
|
113
|
+
readonly "unicorn/prefer-string-trim-start-end": "error";
|
|
114
|
+
readonly "unicorn/filename-case": "off";
|
|
115
|
+
readonly "unicorn/explicit-length-check": ["error", {
|
|
116
|
+
readonly "non-zero": "not-equal";
|
|
117
|
+
}];
|
|
118
|
+
readonly "unicorn/throw-new-error": "error";
|
|
119
|
+
readonly "unicorn/escape-case": "error";
|
|
120
|
+
readonly "unicorn/no-instanceof-array": "error";
|
|
121
|
+
readonly "unicorn/no-new-buffer": "error";
|
|
122
|
+
readonly "unicorn/no-hex-escape": "error";
|
|
123
|
+
readonly "unicorn/custom-error-definition": "error";
|
|
124
|
+
readonly "unicorn/prefer-type-error": "error";
|
|
125
|
+
readonly "unicorn/no-useless-undefined": "off";
|
|
126
|
+
readonly "unicorn/new-for-builtins": "error";
|
|
127
|
+
readonly "unicorn/error-message": "error";
|
|
128
|
+
readonly "@nx/enforce-module-boundaries": ["error", {
|
|
129
|
+
readonly allow: readonly [];
|
|
130
|
+
readonly depConstraints: readonly [{
|
|
131
|
+
sourceTag: string;
|
|
132
|
+
onlyDependOnLibsWithTags: string[];
|
|
133
|
+
}, {
|
|
134
|
+
sourceTag: string;
|
|
135
|
+
onlyDependOnLibsWithTags: string[];
|
|
136
|
+
}, {
|
|
137
|
+
sourceTag: string;
|
|
138
|
+
onlyDependOnLibsWithTags: string[];
|
|
139
|
+
}, {
|
|
140
|
+
sourceTag: string;
|
|
141
|
+
onlyDependOnLibsWithTags: string[];
|
|
142
|
+
}, {
|
|
143
|
+
sourceTag: string;
|
|
144
|
+
onlyDependOnLibsWithTags: string[];
|
|
145
|
+
}, {
|
|
146
|
+
sourceTag: string;
|
|
147
|
+
onlyDependOnLibsWithTags: string[];
|
|
148
|
+
}, {
|
|
149
|
+
sourceTag: string;
|
|
150
|
+
onlyDependOnLibsWithTags: string[];
|
|
151
|
+
}, {
|
|
152
|
+
sourceTag: string;
|
|
153
|
+
onlyDependOnLibsWithTags: string[];
|
|
154
|
+
}, {
|
|
155
|
+
sourceTag: string;
|
|
156
|
+
onlyDependOnLibsWithTags: string[];
|
|
157
|
+
}, {
|
|
158
|
+
sourceTag: string;
|
|
159
|
+
onlyDependOnLibsWithTags: string[];
|
|
160
|
+
}, {
|
|
161
|
+
sourceTag: string;
|
|
162
|
+
bannedExternalImports: string[];
|
|
163
|
+
}];
|
|
164
|
+
}];
|
|
165
|
+
readonly "jsdoc/sort-tags": ["error", {
|
|
166
|
+
readonly reportIntraTagGroupSpacing: false;
|
|
167
|
+
readonly reportTagGroupSpacing: false;
|
|
168
|
+
}];
|
|
169
|
+
readonly "jsdoc/tag-lines": ["error", "always", {
|
|
170
|
+
readonly startLines: 1;
|
|
171
|
+
readonly endLines: 0;
|
|
172
|
+
readonly applyToEndTag: false;
|
|
173
|
+
readonly tags: {
|
|
174
|
+
readonly returns: {
|
|
175
|
+
readonly lines: "always";
|
|
176
|
+
};
|
|
177
|
+
readonly property: {
|
|
178
|
+
readonly lines: "any";
|
|
179
|
+
};
|
|
180
|
+
readonly param: {
|
|
181
|
+
readonly lines: "any";
|
|
182
|
+
};
|
|
183
|
+
readonly example: {
|
|
184
|
+
readonly lines: "always";
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
}];
|
|
188
|
+
readonly "jsdoc/check-indentation": "error";
|
|
189
|
+
readonly "jsdoc/check-alignment": "error";
|
|
190
|
+
readonly "jsdoc/no-bad-blocks": "error";
|
|
191
|
+
readonly "jsdoc/require-asterisk-prefix": ["error", "always"];
|
|
192
|
+
readonly "jsdoc/require-description": "off";
|
|
193
|
+
readonly "jsdoc/require-property-description": "off";
|
|
194
|
+
readonly "jsdoc/require-param-description": "off";
|
|
195
|
+
readonly "jsdoc/require-returns-description": "off";
|
|
196
|
+
readonly "import/no-extraneous-dependencies": ["error", {
|
|
197
|
+
readonly includeTypes: true;
|
|
198
|
+
}];
|
|
199
|
+
readonly "import/no-cycle": ["error", {
|
|
200
|
+
readonly maxDepth: number;
|
|
201
|
+
}];
|
|
202
|
+
readonly "import/no-self-import": "error";
|
|
203
|
+
readonly "import/no-absolute-path": "error";
|
|
204
|
+
readonly "import/default": "error";
|
|
205
|
+
readonly "import/export": "error";
|
|
206
|
+
readonly "import/prefer-default-export": "off";
|
|
207
|
+
readonly "import/namespace": ["error", {
|
|
208
|
+
readonly allowComputed: true;
|
|
209
|
+
}];
|
|
210
|
+
readonly "import/no-duplicates": "error";
|
|
211
|
+
readonly "import/no-named-as-default": "error";
|
|
212
|
+
readonly "import/no-named-as-default-member": "error";
|
|
213
|
+
readonly "import/unambiguous": "off";
|
|
214
|
+
readonly "import/exports-last": "error";
|
|
215
|
+
readonly "import/named": "off";
|
|
216
|
+
readonly "import/no-unresolved": "off";
|
|
217
|
+
readonly "import/extensions": ["error", "always", {
|
|
218
|
+
readonly ignorePackages: true;
|
|
219
|
+
}];
|
|
220
|
+
readonly "import/order": ["error", {
|
|
221
|
+
readonly groups: readonly ["builtin", "external", "internal", readonly ["index", "sibling", "parent"], "object", "unknown"];
|
|
222
|
+
readonly pathGroups: readonly [{
|
|
223
|
+
readonly pattern: "@self-ui/*";
|
|
224
|
+
readonly group: "external";
|
|
225
|
+
readonly position: "after";
|
|
226
|
+
}];
|
|
227
|
+
readonly pathGroupsExcludedImportTypes: readonly ["builtin"];
|
|
228
|
+
readonly alphabetize: {
|
|
229
|
+
readonly order: "asc";
|
|
230
|
+
readonly caseInsensitive: true;
|
|
231
|
+
};
|
|
232
|
+
}];
|
|
233
|
+
readonly "no-restricted-exports": ["error", {
|
|
234
|
+
readonly restrictDefaultExports: {
|
|
235
|
+
readonly named: false;
|
|
236
|
+
readonly namedFrom: false;
|
|
237
|
+
};
|
|
238
|
+
}];
|
|
239
|
+
readonly "no-underscore-dangle": ["error", {
|
|
240
|
+
readonly allow: readonly ["_dirname", "_testResult"];
|
|
241
|
+
readonly allowInArrayDestructuring: true;
|
|
242
|
+
readonly allowInObjectDestructuring: true;
|
|
243
|
+
}];
|
|
244
|
+
};
|
|
245
|
+
let settings: {
|
|
246
|
+
readonly [x: string]: unknown;
|
|
247
|
+
};
|
|
248
|
+
}
|