eslint-config-decent 1.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 +20 -0
- package/dist/index.cjs +540 -0
- package/dist/index.d.cts +31 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.mjs +520 -0
- package/package.json +100 -0
- package/src/eslint.ts +258 -0
- package/src/index.ts +92 -0
- package/src/jsdoc.ts +36 -0
- package/src/mocha.ts +32 -0
- package/src/promise.ts +28 -0
- package/src/security.ts +31 -0
- package/src/types/eslint-js.d.ts +9 -0
- package/src/types/eslint-plugin-mocha.d.ts +9 -0
- package/src/types/eslint-plugin-promise.d.ts +5 -0
- package/src/types/eslint-plugin-security.d.ts +5 -0
- package/src/types/eslint-plugin-unicorn.d.ts +5 -0
- package/src/typescriptEslint.ts +79 -0
- package/src/unicorn.ts +25 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 James Geurts
|
|
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,20 @@
|
|
|
1
|
+
# eslint-config-decent
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.org/package/eslint-config-decent)
|
|
4
|
+
|
|
5
|
+
A decent ESLint configuration for TypeScript projects.
|
|
6
|
+
|
|
7
|
+
## Example usage
|
|
8
|
+
|
|
9
|
+
```mjs
|
|
10
|
+
// eslint.config.mjs
|
|
11
|
+
|
|
12
|
+
import { defaultConfig } from 'eslint-config-decent';
|
|
13
|
+
import tsEslint from 'typescript-eslint';
|
|
14
|
+
|
|
15
|
+
export default tsEslint.config(...defaultConfig());
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## License
|
|
19
|
+
|
|
20
|
+
MIT
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const eslint = require('@eslint/js');
|
|
4
|
+
const globals = require('globals');
|
|
5
|
+
const tsEslint = require('typescript-eslint');
|
|
6
|
+
const prettier = require('eslint-plugin-prettier/recommended');
|
|
7
|
+
const jsdoc = require('eslint-plugin-jsdoc');
|
|
8
|
+
const mocha = require('eslint-plugin-mocha');
|
|
9
|
+
const promise = require('eslint-plugin-promise');
|
|
10
|
+
const security = require('eslint-plugin-security');
|
|
11
|
+
const unicorn = require('eslint-plugin-unicorn');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
14
|
+
|
|
15
|
+
const eslint__default = /*#__PURE__*/_interopDefaultCompat(eslint);
|
|
16
|
+
const globals__default = /*#__PURE__*/_interopDefaultCompat(globals);
|
|
17
|
+
const tsEslint__default = /*#__PURE__*/_interopDefaultCompat(tsEslint);
|
|
18
|
+
const prettier__default = /*#__PURE__*/_interopDefaultCompat(prettier);
|
|
19
|
+
const jsdoc__default = /*#__PURE__*/_interopDefaultCompat(jsdoc);
|
|
20
|
+
const mocha__default = /*#__PURE__*/_interopDefaultCompat(mocha);
|
|
21
|
+
const promise__default = /*#__PURE__*/_interopDefaultCompat(promise);
|
|
22
|
+
const security__default = /*#__PURE__*/_interopDefaultCompat(security);
|
|
23
|
+
const unicorn__default = /*#__PURE__*/_interopDefaultCompat(unicorn);
|
|
24
|
+
|
|
25
|
+
const base$6 = {
|
|
26
|
+
rules: {
|
|
27
|
+
"array-callback-return": ["error", { allowImplicit: true }],
|
|
28
|
+
"block-scoped-var": "error",
|
|
29
|
+
"callback-return": ["error", ["callback", "cb", "next", "done"]],
|
|
30
|
+
"class-methods-use-this": [
|
|
31
|
+
"error",
|
|
32
|
+
{
|
|
33
|
+
exceptMethods: []
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"default-case": ["error", { commentPattern: "^no default$" }],
|
|
37
|
+
"default-case-last": "error",
|
|
38
|
+
eqeqeq: ["error", "smart"],
|
|
39
|
+
"func-names": "error",
|
|
40
|
+
"func-style": [
|
|
41
|
+
"error",
|
|
42
|
+
"declaration",
|
|
43
|
+
{
|
|
44
|
+
allowArrowFunctions: false
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"global-require": "error",
|
|
48
|
+
"grouped-accessor-pairs": "error",
|
|
49
|
+
"guard-for-in": "error",
|
|
50
|
+
"id-length": [
|
|
51
|
+
"error",
|
|
52
|
+
{
|
|
53
|
+
exceptions: ["_", "$", "e", "i", "j", "k", "q", "x", "y"]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"lines-around-directive": [
|
|
57
|
+
"error",
|
|
58
|
+
{
|
|
59
|
+
before: "always",
|
|
60
|
+
after: "always"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"handle-callback-err": ["error", "^.*err"],
|
|
64
|
+
"max-classes-per-file": ["error", 1],
|
|
65
|
+
"object-shorthand": [
|
|
66
|
+
"error",
|
|
67
|
+
"always",
|
|
68
|
+
{
|
|
69
|
+
ignoreConstructors: false,
|
|
70
|
+
avoidQuotes: true,
|
|
71
|
+
avoidExplicitReturnArrows: true
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"one-var": ["error", "never"],
|
|
75
|
+
"operator-assignment": ["error", "always"],
|
|
76
|
+
"no-await-in-loop": "error",
|
|
77
|
+
"no-bitwise": "error",
|
|
78
|
+
"no-buffer-constructor": "error",
|
|
79
|
+
"no-caller": "error",
|
|
80
|
+
"no-cond-assign": ["error", "always"],
|
|
81
|
+
"no-console": "error",
|
|
82
|
+
"no-constructor-return": "error",
|
|
83
|
+
"no-else-return": ["error", { allowElseIf: false }],
|
|
84
|
+
"no-empty-static-block": "error",
|
|
85
|
+
"no-eval": "error",
|
|
86
|
+
"no-extend-native": "error",
|
|
87
|
+
"no-extra-bind": "error",
|
|
88
|
+
"no-extra-label": "error",
|
|
89
|
+
"no-inner-declarations": "error",
|
|
90
|
+
"no-iterator": "error",
|
|
91
|
+
"no-label-var": "error",
|
|
92
|
+
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
93
|
+
"no-lone-blocks": "error",
|
|
94
|
+
"no-lonely-if": "error",
|
|
95
|
+
"no-mixed-spaces-and-tabs": "error",
|
|
96
|
+
"no-multi-assign": ["error"],
|
|
97
|
+
"no-multi-str": "error",
|
|
98
|
+
"no-negated-condition": "error",
|
|
99
|
+
"no-nested-ternary": "error",
|
|
100
|
+
"no-new-object": "error",
|
|
101
|
+
"no-new-require": "error",
|
|
102
|
+
"no-new-wrappers": "error",
|
|
103
|
+
"no-octal-escape": "error",
|
|
104
|
+
"no-path-concat": "error",
|
|
105
|
+
"no-promise-executor-return": "error",
|
|
106
|
+
"no-proto": "error",
|
|
107
|
+
"no-restricted-exports": [
|
|
108
|
+
"error",
|
|
109
|
+
{
|
|
110
|
+
restrictedNamedExports: [
|
|
111
|
+
"default",
|
|
112
|
+
// use `export default` to provide a default export
|
|
113
|
+
"then"
|
|
114
|
+
// this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"no-restricted-globals": [
|
|
119
|
+
"error",
|
|
120
|
+
{
|
|
121
|
+
name: "isFinite",
|
|
122
|
+
message: "Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "isNaN",
|
|
126
|
+
message: "Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"no-restricted-properties": [
|
|
130
|
+
"error",
|
|
131
|
+
{
|
|
132
|
+
object: "arguments",
|
|
133
|
+
property: "callee",
|
|
134
|
+
message: "arguments.callee is deprecated"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
property: "__defineGetter__",
|
|
138
|
+
message: "Please use Object.defineProperty instead."
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
property: "__defineSetter__",
|
|
142
|
+
message: "Please use Object.defineProperty instead."
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"no-restricted-syntax": ["error", "DebuggerStatement", "LabeledStatement", "WithStatement"],
|
|
146
|
+
"no-return-assign": ["error", "always"],
|
|
147
|
+
"no-self-compare": "error",
|
|
148
|
+
"no-sequences": "error",
|
|
149
|
+
"no-script-url": "error",
|
|
150
|
+
"no-template-curly-in-string": "error",
|
|
151
|
+
"no-undef-init": "error",
|
|
152
|
+
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
153
|
+
"no-unreachable-loop": [
|
|
154
|
+
"error",
|
|
155
|
+
{
|
|
156
|
+
ignore: []
|
|
157
|
+
// WhileStatement, DoWhileStatement, ForStatement, ForInStatement, ForOfStatement
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"no-unused-expressions": [
|
|
161
|
+
"error",
|
|
162
|
+
{
|
|
163
|
+
allowShortCircuit: false,
|
|
164
|
+
allowTernary: false,
|
|
165
|
+
allowTaggedTemplates: false
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"no-useless-computed-key": "error",
|
|
169
|
+
"no-useless-concat": "error",
|
|
170
|
+
"no-useless-rename": "error",
|
|
171
|
+
"no-useless-return": "error",
|
|
172
|
+
"padding-line-between-statements": [
|
|
173
|
+
"error",
|
|
174
|
+
{
|
|
175
|
+
blankLine: "always",
|
|
176
|
+
prev: ["directive", "block", "block-like", "multiline-block-like", "cjs-export", "cjs-import", "class", "export", "import", "if"],
|
|
177
|
+
next: "*"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
blankLine: "never",
|
|
181
|
+
prev: "directive",
|
|
182
|
+
next: "directive"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
blankLine: "any",
|
|
186
|
+
prev: "*",
|
|
187
|
+
next: ["if", "for", "cjs-import", "import"]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
blankLine: "any",
|
|
191
|
+
prev: ["export", "import"],
|
|
192
|
+
next: ["export", "import"]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
blankLine: "always",
|
|
196
|
+
prev: "*",
|
|
197
|
+
next: ["try", "function", "switch"]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
blankLine: "always",
|
|
201
|
+
prev: "if",
|
|
202
|
+
next: "if"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
blankLine: "never",
|
|
206
|
+
prev: ["return", "throw"],
|
|
207
|
+
next: "*"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"prefer-const": [
|
|
211
|
+
"error",
|
|
212
|
+
{
|
|
213
|
+
destructuring: "any",
|
|
214
|
+
ignoreReadBeforeAssign: true
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"prefer-exponentiation-operator": "error",
|
|
218
|
+
"prefer-numeric-literals": "error",
|
|
219
|
+
"prefer-object-spread": "error",
|
|
220
|
+
"prefer-regex-literals": [
|
|
221
|
+
"error",
|
|
222
|
+
{
|
|
223
|
+
disallowRedundantWrapping: true
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"prefer-template": "error",
|
|
227
|
+
"symbol-description": "error",
|
|
228
|
+
"unicode-bom": ["error", "never"],
|
|
229
|
+
"vars-on-top": "error",
|
|
230
|
+
yoda: "error"
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
const cjsAndEsm = {
|
|
234
|
+
rules: {
|
|
235
|
+
curly: ["error", "multi-line"],
|
|
236
|
+
"dot-notation": ["error", { allowKeywords: true }],
|
|
237
|
+
"dot-location": ["error", "property"],
|
|
238
|
+
"getter-return": ["error", { allowImplicit: true }],
|
|
239
|
+
"lines-between-class-members": ["error", "always", { exceptAfterSingleLine: false }],
|
|
240
|
+
"no-array-constructor": "error",
|
|
241
|
+
"no-empty-function": [
|
|
242
|
+
"error",
|
|
243
|
+
{
|
|
244
|
+
allow: ["arrowFunctions", "functions", "methods"]
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
"no-new-func": "error",
|
|
248
|
+
"no-new-symbol": "error",
|
|
249
|
+
"no-return-await": "error",
|
|
250
|
+
"no-shadow": "error",
|
|
251
|
+
"no-undef": "error",
|
|
252
|
+
"no-unexpected-multiline": "error",
|
|
253
|
+
"no-use-before-define": ["error", { functions: true, classes: true, variables: true }],
|
|
254
|
+
"no-useless-constructor": "error",
|
|
255
|
+
"no-var": "error",
|
|
256
|
+
"prefer-arrow-callback": [
|
|
257
|
+
"error",
|
|
258
|
+
{
|
|
259
|
+
allowNamedFunctions: false,
|
|
260
|
+
allowUnboundThis: true
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
"prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
|
|
264
|
+
"wrap-iife": ["error", "outside", { functionPrototypeMethods: false }]
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
const cjs = {
|
|
268
|
+
rules: {
|
|
269
|
+
strict: ["error", "global"]
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
const configs$6 = {
|
|
273
|
+
base: base$6,
|
|
274
|
+
cjsAndEsm,
|
|
275
|
+
cjs
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
const base$5 = {
|
|
279
|
+
settings: {
|
|
280
|
+
jsdoc: {
|
|
281
|
+
preferredTypes: {
|
|
282
|
+
Array: "Array<object>",
|
|
283
|
+
"Array.": "Array<object>",
|
|
284
|
+
"Array<>": "[]",
|
|
285
|
+
"Array.<>": "[]",
|
|
286
|
+
"Promise.<>": "Promise<>"
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
plugins: {
|
|
291
|
+
jsdoc: jsdoc__default
|
|
292
|
+
},
|
|
293
|
+
rules: {
|
|
294
|
+
"unicorn/better-regex": "error",
|
|
295
|
+
"unicorn/custom-error-definition": "error",
|
|
296
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
297
|
+
"unicorn/no-for-loop": "error",
|
|
298
|
+
"unicorn/prefer-array-find": "error",
|
|
299
|
+
"unicorn/prefer-object-from-entries": "error",
|
|
300
|
+
"unicorn/prefer-set-has": "error"
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
const configs$5 = {
|
|
304
|
+
base: base$5
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
const base$4 = {
|
|
308
|
+
plugins: {
|
|
309
|
+
mocha: mocha__default
|
|
310
|
+
},
|
|
311
|
+
rules: {
|
|
312
|
+
...mocha__default.configs.recommended.rules,
|
|
313
|
+
"max-classes-per-file": "off",
|
|
314
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
315
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
316
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
317
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
318
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
319
|
+
"@typescript-eslint/unbound-method": "off",
|
|
320
|
+
"mocha/no-exclusive-tests": "error",
|
|
321
|
+
"mocha/no-pending-tests": "error",
|
|
322
|
+
"mocha/no-mocha-arrows": "off"
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
const configs$4 = {
|
|
326
|
+
base: base$4
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
const base$3 = {
|
|
330
|
+
plugins: {
|
|
331
|
+
promise: promise__default
|
|
332
|
+
},
|
|
333
|
+
rules: {
|
|
334
|
+
"promise/always-return": "error",
|
|
335
|
+
"promise/always-catch": "off",
|
|
336
|
+
"promise/catch-or-return": [
|
|
337
|
+
"error",
|
|
338
|
+
{
|
|
339
|
+
allowThen: true
|
|
340
|
+
}
|
|
341
|
+
],
|
|
342
|
+
"promise/no-native": "off",
|
|
343
|
+
"promise/param-names": "error"
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
const configs$3 = {
|
|
347
|
+
base: base$3
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
const base$2 = {
|
|
351
|
+
plugins: {
|
|
352
|
+
security: security__default
|
|
353
|
+
},
|
|
354
|
+
rules: {
|
|
355
|
+
"security/detect-buffer-noassert": "error",
|
|
356
|
+
"security/detect-child-process": "error",
|
|
357
|
+
"security/detect-disable-mustache-escape": "error",
|
|
358
|
+
"security/detect-eval-with-expression": "error",
|
|
359
|
+
"security/detect-new-buffer": "error",
|
|
360
|
+
"security/detect-no-csrf-before-method-override": "error",
|
|
361
|
+
"security/detect-non-literal-fs-filename": "error",
|
|
362
|
+
"security/detect-non-literal-regexp": "error",
|
|
363
|
+
"security/detect-non-literal-require": "error",
|
|
364
|
+
"security/detect-object-injection": "off",
|
|
365
|
+
"security/detect-possible-timing-attacks": "error",
|
|
366
|
+
"security/detect-pseudoRandomBytes": "error",
|
|
367
|
+
"security/detect-unsafe-regex": "error"
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
const configs$2 = {
|
|
371
|
+
base: base$2
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
const base$1 = {
|
|
375
|
+
rules: {
|
|
376
|
+
"no-loss-of-precision": "off",
|
|
377
|
+
"no-loop-func": "off",
|
|
378
|
+
"no-return-await": "off",
|
|
379
|
+
"no-unused-expressions": "off",
|
|
380
|
+
"no-use-before-defined": "off",
|
|
381
|
+
"@typescript-eslint/array-type": [
|
|
382
|
+
"error",
|
|
383
|
+
{
|
|
384
|
+
default: "array"
|
|
385
|
+
}
|
|
386
|
+
],
|
|
387
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
388
|
+
"@typescript-eslint/default-param-last": "error",
|
|
389
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
390
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
391
|
+
"@typescript-eslint/naming-convention": [
|
|
392
|
+
"error",
|
|
393
|
+
{
|
|
394
|
+
selector: "enumMember",
|
|
395
|
+
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
|
396
|
+
trailingUnderscore: "forbid"
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
"@typescript-eslint/no-dupe-class-members": "error",
|
|
400
|
+
"@typescript-eslint/no-loop-func": "error",
|
|
401
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
402
|
+
"@typescript-eslint/member-ordering": [
|
|
403
|
+
"error",
|
|
404
|
+
{
|
|
405
|
+
default: [
|
|
406
|
+
"signature",
|
|
407
|
+
"private-field",
|
|
408
|
+
"public-field",
|
|
409
|
+
"protected-field",
|
|
410
|
+
"public-constructor",
|
|
411
|
+
"protected-constructor",
|
|
412
|
+
"private-constructor",
|
|
413
|
+
"public-method",
|
|
414
|
+
"protected-method",
|
|
415
|
+
"private-method"
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
"@typescript-eslint/only-throw-error": "error",
|
|
420
|
+
"@typescript-eslint/no-empty-interface": "error",
|
|
421
|
+
"@typescript-eslint/no-extra-semi": "error",
|
|
422
|
+
"@typescript-eslint/no-shadow": "error",
|
|
423
|
+
"@typescript-eslint/no-use-before-define": [
|
|
424
|
+
"error",
|
|
425
|
+
{
|
|
426
|
+
functions: true,
|
|
427
|
+
classes: true,
|
|
428
|
+
variables: true
|
|
429
|
+
}
|
|
430
|
+
],
|
|
431
|
+
"@typescript-eslint/parameter-properties": [
|
|
432
|
+
"error",
|
|
433
|
+
{
|
|
434
|
+
allow: ["readonly"]
|
|
435
|
+
}
|
|
436
|
+
],
|
|
437
|
+
"@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
|
|
438
|
+
"@typescript-eslint/return-await": "error",
|
|
439
|
+
"@typescript-eslint/sort-type-constituents": "error"
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
const configs$1 = {
|
|
443
|
+
base: base$1
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
const base = {
|
|
447
|
+
plugins: {
|
|
448
|
+
unicorn: unicorn__default
|
|
449
|
+
},
|
|
450
|
+
rules: {
|
|
451
|
+
"unicorn/better-regex": "error",
|
|
452
|
+
"unicorn/custom-error-definition": "error",
|
|
453
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
454
|
+
"unicorn/no-for-loop": "error",
|
|
455
|
+
"unicorn/prefer-array-find": "error",
|
|
456
|
+
"unicorn/prefer-object-from-entries": "error",
|
|
457
|
+
"unicorn/prefer-set-has": "error"
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
const configs = {
|
|
461
|
+
base
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
function defaultConfig(parserOptions) {
|
|
465
|
+
const languageOptions = {
|
|
466
|
+
globals: {
|
|
467
|
+
...globals__default.node
|
|
468
|
+
},
|
|
469
|
+
parserOptions: {
|
|
470
|
+
// @ts-expect-error - This is a valid option
|
|
471
|
+
projectService: {
|
|
472
|
+
allowedDefaultProject: ["./*.js", "./*.cjs", "./*.mjs", "./tests/**/*.ts", "./tests/**/*.js", "./tests/**/*.cjs", "./tests/**/*.mjs"],
|
|
473
|
+
defaultProject: "tsconfig.json"
|
|
474
|
+
},
|
|
475
|
+
tsconfigRootDir: undefined,
|
|
476
|
+
...parserOptions
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
return [
|
|
480
|
+
{
|
|
481
|
+
ignores: ["**/dist/**", "**/node_modules/**"]
|
|
482
|
+
},
|
|
483
|
+
eslint__default.configs.recommended,
|
|
484
|
+
...tsEslint__default.configs.strictTypeChecked,
|
|
485
|
+
...tsEslint__default.configs.stylisticTypeChecked,
|
|
486
|
+
{
|
|
487
|
+
languageOptions,
|
|
488
|
+
settings: {
|
|
489
|
+
...configs$5.base.settings
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
files: ["**/*.ts", "**/*.js", "**/*.cjs", "**/*.mjs"],
|
|
494
|
+
plugins: {
|
|
495
|
+
...configs$5.base.plugins,
|
|
496
|
+
...configs$3.base.plugins,
|
|
497
|
+
...configs$2.base.plugins,
|
|
498
|
+
...configs.base.plugins
|
|
499
|
+
},
|
|
500
|
+
rules: {
|
|
501
|
+
...configs$6.base.rules,
|
|
502
|
+
...configs$5.base.rules,
|
|
503
|
+
...configs$3.base.rules,
|
|
504
|
+
...configs$2.base.rules,
|
|
505
|
+
...configs.base.rules
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
files: ["**/*.js", "**/*.cjs", "**/*.mjs"],
|
|
510
|
+
languageOptions: {
|
|
511
|
+
sourceType: "script"
|
|
512
|
+
},
|
|
513
|
+
...configs$6.cjsAndEsm
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
files: ["**/*.js", "**/*.cjs"],
|
|
517
|
+
languageOptions: {
|
|
518
|
+
sourceType: "script"
|
|
519
|
+
},
|
|
520
|
+
...configs$6.cjs
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
files: ["**/*.ts"],
|
|
524
|
+
...configs$1.base
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
files: ["**/*.tests.ts", "tests/tests.ts"],
|
|
528
|
+
...configs$4.base
|
|
529
|
+
},
|
|
530
|
+
prettier__default
|
|
531
|
+
];
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
exports.defaultConfig = defaultConfig;
|
|
535
|
+
exports.eslintConfigs = configs$6;
|
|
536
|
+
exports.jsdocConfigs = configs$5;
|
|
537
|
+
exports.promiseConfigs = configs$3;
|
|
538
|
+
exports.securityConfigs = configs$2;
|
|
539
|
+
exports.typescriptEslintConfigs = configs$1;
|
|
540
|
+
exports.unicornConfigs = configs;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ConfigWithExtends } from 'typescript-eslint';
|
|
2
|
+
|
|
3
|
+
declare const configs$5: {
|
|
4
|
+
base: ConfigWithExtends;
|
|
5
|
+
cjsAndEsm: ConfigWithExtends;
|
|
6
|
+
cjs: ConfigWithExtends;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare const configs$4: {
|
|
10
|
+
base: ConfigWithExtends;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare const configs$3: {
|
|
14
|
+
base: ConfigWithExtends;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare const configs$2: {
|
|
18
|
+
base: ConfigWithExtends;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
declare const configs$1: {
|
|
22
|
+
base: ConfigWithExtends;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare const configs: {
|
|
26
|
+
base: ConfigWithExtends;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
declare function defaultConfig(parserOptions?: NonNullable<ConfigWithExtends['languageOptions']>['parserOptions']): ConfigWithExtends[];
|
|
30
|
+
|
|
31
|
+
export { defaultConfig, configs$5 as eslintConfigs, configs$4 as jsdocConfigs, configs$3 as promiseConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ConfigWithExtends } from 'typescript-eslint';
|
|
2
|
+
|
|
3
|
+
declare const configs$5: {
|
|
4
|
+
base: ConfigWithExtends;
|
|
5
|
+
cjsAndEsm: ConfigWithExtends;
|
|
6
|
+
cjs: ConfigWithExtends;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare const configs$4: {
|
|
10
|
+
base: ConfigWithExtends;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare const configs$3: {
|
|
14
|
+
base: ConfigWithExtends;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare const configs$2: {
|
|
18
|
+
base: ConfigWithExtends;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
declare const configs$1: {
|
|
22
|
+
base: ConfigWithExtends;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare const configs: {
|
|
26
|
+
base: ConfigWithExtends;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
declare function defaultConfig(parserOptions?: NonNullable<ConfigWithExtends['languageOptions']>['parserOptions']): ConfigWithExtends[];
|
|
30
|
+
|
|
31
|
+
export { defaultConfig, configs$5 as eslintConfigs, configs$4 as jsdocConfigs, configs$3 as promiseConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ConfigWithExtends } from 'typescript-eslint';
|
|
2
|
+
|
|
3
|
+
declare const configs$5: {
|
|
4
|
+
base: ConfigWithExtends;
|
|
5
|
+
cjsAndEsm: ConfigWithExtends;
|
|
6
|
+
cjs: ConfigWithExtends;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare const configs$4: {
|
|
10
|
+
base: ConfigWithExtends;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare const configs$3: {
|
|
14
|
+
base: ConfigWithExtends;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare const configs$2: {
|
|
18
|
+
base: ConfigWithExtends;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
declare const configs$1: {
|
|
22
|
+
base: ConfigWithExtends;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare const configs: {
|
|
26
|
+
base: ConfigWithExtends;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
declare function defaultConfig(parserOptions?: NonNullable<ConfigWithExtends['languageOptions']>['parserOptions']): ConfigWithExtends[];
|
|
30
|
+
|
|
31
|
+
export { defaultConfig, configs$5 as eslintConfigs, configs$4 as jsdocConfigs, configs$3 as promiseConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
|