eslint-config-complete 1.2.1 → 1.2.3

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.
Files changed (39) hide show
  1. package/dist/base/base-eslint.d.ts +12 -0
  2. package/dist/base/base-eslint.d.ts.map +1 -0
  3. package/dist/base/base-eslint.js +670 -0
  4. package/dist/base/base-import-x.d.ts +12 -0
  5. package/dist/base/base-import-x.d.ts.map +1 -0
  6. package/dist/base/base-import-x.js +262 -0
  7. package/dist/base/base-jsdoc.d.ts +6 -0
  8. package/dist/base/base-jsdoc.d.ts.map +1 -0
  9. package/dist/base/base-jsdoc.js +212 -0
  10. package/dist/base/base-n.d.ts +7 -0
  11. package/dist/base/base-n.d.ts.map +1 -0
  12. package/dist/base/base-n.js +108 -0
  13. package/dist/base/base-stylistic.d.ts +6 -0
  14. package/dist/base/base-stylistic.d.ts.map +1 -0
  15. package/dist/base/base-stylistic.js +35 -0
  16. package/dist/base/base-typescript-eslint.d.ts +6 -0
  17. package/dist/base/base-typescript-eslint.d.ts.map +1 -0
  18. package/dist/base/base-typescript-eslint.js +476 -0
  19. package/dist/base/base-unicorn.d.ts +10 -0
  20. package/dist/base/base-unicorn.d.ts.map +1 -0
  21. package/dist/base/base-unicorn.js +203 -0
  22. package/dist/base.d.ts +8 -0
  23. package/dist/base.d.ts.map +1 -0
  24. package/{src → dist}/base.js +17 -30
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/monorepo.d.ts +6 -0
  28. package/dist/monorepo.d.ts.map +1 -0
  29. package/dist/monorepo.js +16 -0
  30. package/package.json +5 -3
  31. package/src/base/base-eslint.js +0 -850
  32. package/src/base/base-import-x.js +0 -310
  33. package/src/base/base-jsdoc.js +0 -276
  34. package/src/base/base-n.js +0 -150
  35. package/src/base/base-stylistic.js +0 -38
  36. package/src/base/base-typescript-eslint.js +0 -554
  37. package/src/base/base-unicorn.js +0 -246
  38. package/src/monorepo.js +0 -18
  39. /package/{src → dist}/index.js +0 -0
@@ -0,0 +1,35 @@
1
+ import ESLintPluginStylistic from "@stylistic/eslint-plugin";
2
+ import tseslint from "typescript-eslint";
3
+ /**
4
+ * This ESLint config only contains rules from `@stylistic/eslint-plugin`:
5
+ * https://eslint.style/
6
+ */
7
+ export const baseStylistic = tseslint.config({
8
+ plugins: {
9
+ // @ts-expect-error https://github.com/eslint-stylistic/eslint-stylistic/issues/506
10
+ "@stylistic": ESLintPluginStylistic,
11
+ },
12
+ rules: {
13
+ /** This rule is not handled by Prettier, so we must use ESLint to enforce it. */
14
+ "@stylistic/lines-between-class-members": [
15
+ "warn",
16
+ "always",
17
+ {
18
+ exceptAfterSingleLine: true,
19
+ },
20
+ ],
21
+ /**
22
+ * We forbid unnecessary backticks by using the options specified in [the
23
+ * `eslint-config-prettier`
24
+ * documentation](https://github.com/prettier/eslint-config-prettier#enforce-backticks).
25
+ */
26
+ "@stylistic/quotes": [
27
+ "warn",
28
+ "double",
29
+ {
30
+ avoidEscape: true,
31
+ allowTemplateLiterals: false,
32
+ },
33
+ ],
34
+ },
35
+ });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This ESLint config only contains rules from `@typescript-eslint/eslint-plugin`:
3
+ * https://typescript-eslint.io/rules/
4
+ */
5
+ export const baseTypeScriptESLint: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
6
+ //# sourceMappingURL=base-typescript-eslint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-typescript-eslint.d.ts","sourceRoot":"","sources":["../../src/base/base-typescript-eslint.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,uGAmiBE"}
@@ -0,0 +1,476 @@
1
+ import tseslint from "typescript-eslint";
2
+ /**
3
+ * This ESLint config only contains rules from `@typescript-eslint/eslint-plugin`:
4
+ * https://typescript-eslint.io/rules/
5
+ */
6
+ export const baseTypeScriptESLint = tseslint.config({
7
+ plugins: {
8
+ "@typescript-eslint": tseslint.plugin,
9
+ },
10
+ // We need to provide some special configuration to ESLint in order for it to parse TypeScript
11
+ // files. From:
12
+ // https://typescript-eslint.io/packages/typescript-eslint/#advanced-usage
13
+ languageOptions: {
14
+ parser: tseslint.parser,
15
+ parserOptions: {
16
+ projectService: {
17
+ // We whitelist some specific configuration files that downstream users may have in their
18
+ // projects. These files should be linted but should not be included in compiled output.
19
+ allowDefaultProject: [
20
+ "babel.config.js",
21
+ "babel.config.cjs",
22
+ "babel.config.mjs",
23
+ "eslint.config.js",
24
+ "eslint.config.cjs",
25
+ "eslint.config.mjs",
26
+ "jest.config.js",
27
+ "jest.config.cjs",
28
+ "jest.config.mjs",
29
+ "knip.js",
30
+ "knip.ts",
31
+ "knip.config.js",
32
+ "knip.config.ts",
33
+ "prettier.config.js",
34
+ "prettier.config.cjs",
35
+ "prettier.config.mjs",
36
+ "typedoc.config.js",
37
+ "typedoc.config.cjs",
38
+ "typedoc.config.mjs",
39
+ ],
40
+ // By default, the whitelisted files above will use the default TypeScript compiler
41
+ // options. However, certain ESLint rules such as
42
+ // "@typescript-eslint/no-unnecessary-condition" and
43
+ // "@typescript-eslint/prefer-nullish-coalescing" require "strictNullChecks", which is not
44
+ // a default option. Thus, we need to specify that whitelisted files should use the
45
+ // "tsconfig.json" file that is beside the file in the same directory.
46
+ defaultProject: "tsconfig.json",
47
+ },
48
+ },
49
+ },
50
+ rules: {
51
+ "@typescript-eslint/adjacent-overload-signatures": "warn",
52
+ /**
53
+ * The default value is `array`. We choose `array-simple` because it makes complicated arrays
54
+ * easier to understand. This is worth the cost of deviating from the base rule configuration.
55
+ */
56
+ "@typescript-eslint/array-type": [
57
+ "warn",
58
+ {
59
+ default: "array-simple",
60
+ },
61
+ ],
62
+ "@typescript-eslint/await-thenable": "warn",
63
+ "@typescript-eslint/ban-ts-comment": "warn",
64
+ "@typescript-eslint/ban-tslint-comment": "warn",
65
+ "@typescript-eslint/class-literal-property-style": "warn",
66
+ "@typescript-eslint/consistent-generic-constructors": "warn",
67
+ "@typescript-eslint/consistent-indexed-object-style": "warn",
68
+ "@typescript-eslint/consistent-type-assertions": "warn",
69
+ "@typescript-eslint/consistent-type-definitions": "warn",
70
+ "@typescript-eslint/consistent-type-exports": "warn",
71
+ "@typescript-eslint/consistent-type-imports": "warn",
72
+ /**
73
+ * Disabled since it would be to cumbersome to require return types for non-exported
74
+ * functions. (It is more reasonable to require it for exported functions only, since it
75
+ * speeds up the type-checker in large codebases.)
76
+ */
77
+ "@typescript-eslint/explicit-function-return-type": "off",
78
+ /**
79
+ * Disabled since many programs may have internal-only classes that would not benefit from an
80
+ * explicit public/private distinction.
81
+ */
82
+ "@typescript-eslint/explicit-member-accessibility": "off",
83
+ "@typescript-eslint/explicit-module-boundary-types": "warn",
84
+ /**
85
+ * Disabled because enforcing an arbitrary parameter number threshold for every function in a
86
+ * project does not provide much value. (Additionally, using TypeScript reduces the value of
87
+ * such a check.)
88
+ */
89
+ "@typescript-eslint/max-params": "off",
90
+ "@typescript-eslint/member-delimiter-style": "off", // eslint-config-prettier
91
+ /** Disabled since prescribed class ordering is too project-specific. */
92
+ "@typescript-eslint/member-ordering": "off",
93
+ "@typescript-eslint/method-signature-style": "warn",
94
+ /**
95
+ * The options are [copied from
96
+ * Airbnb](https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/lib/shared.js).
97
+ * We also allow a leading underscore, which signifies that the element is temporarily not
98
+ * being used.
99
+ */
100
+ "@typescript-eslint/naming-convention": [
101
+ "warn",
102
+ // Allow camelCase variables (23.2), PascalCase variables (23.8), and UPPER_CASE variables
103
+ // (23.10).
104
+ {
105
+ selector: "variable",
106
+ format: ["camelCase", "PascalCase", "UPPER_CASE"],
107
+ leadingUnderscore: "allow",
108
+ },
109
+ // Allow camelCase functions (23.2), and PascalCase functions (23.8).
110
+ {
111
+ selector: "function",
112
+ format: ["camelCase", "PascalCase"],
113
+ leadingUnderscore: "allow",
114
+ },
115
+ // Airbnb recommends PascalCase for classes (23.3), and although Airbnb does not make
116
+ // TypeScript recommendations, we are assuming this rule would similarly apply to anything
117
+ // "type like", including interfaces, type aliases, and enums.
118
+ {
119
+ selector: "typeLike",
120
+ format: ["PascalCase"],
121
+ leadingUnderscore: "allow",
122
+ },
123
+ ],
124
+ "@typescript-eslint/no-base-to-string": "warn",
125
+ "@typescript-eslint/no-confusing-non-null-assertion": "warn",
126
+ "@typescript-eslint/no-confusing-void-expression": "warn",
127
+ "@typescript-eslint/no-deprecated": "warn",
128
+ "@typescript-eslint/no-duplicate-enum-values": "warn",
129
+ "@typescript-eslint/no-duplicate-type-constituents": "warn",
130
+ "@typescript-eslint/no-dynamic-delete": "warn",
131
+ /**
132
+ * The `allowSingleExtends` option is enabled to allow for the common pattern of using using
133
+ * interfaces to provide an opaque type. (This can be useful with type-builders such as Zod,
134
+ * since `z.infer` uses `Expand`, which is sometimes not desired since it can lead to
135
+ * verbose/confusing mouseover tooltips and TypeScript errors.)
136
+ */
137
+ "@typescript-eslint/no-empty-interface": [
138
+ "warn",
139
+ {
140
+ allowSingleExtends: true,
141
+ },
142
+ ],
143
+ "@typescript-eslint/no-empty-object-type": "warn",
144
+ "@typescript-eslint/no-explicit-any": "warn",
145
+ "@typescript-eslint/no-extra-non-null-assertion": "warn",
146
+ "@typescript-eslint/no-extraneous-class": "warn",
147
+ /**
148
+ * - The `ignoreVoid` option is disabled to make the rule stricter.
149
+ * - The rule is disabled in "*.test.ts" files because the built-in Node test runner returns a
150
+ * promise that is not meant to be awaited.
151
+ */
152
+ "@typescript-eslint/no-floating-promises": [
153
+ "warn",
154
+ {
155
+ ignoreVoid: false,
156
+ },
157
+ ],
158
+ "@typescript-eslint/no-for-in-array": "warn",
159
+ "@typescript-eslint/no-import-type-side-effects": "warn",
160
+ "@typescript-eslint/no-inferrable-types": "warn",
161
+ "@typescript-eslint/no-invalid-void-type": "warn",
162
+ "@typescript-eslint/no-meaningless-void-operator": "warn",
163
+ "@typescript-eslint/no-misused-new": "warn",
164
+ "@typescript-eslint/no-misused-promises": "warn",
165
+ "@typescript-eslint/no-mixed-enums": "warn",
166
+ "@typescript-eslint/no-namespace": "warn",
167
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn",
168
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
169
+ "@typescript-eslint/no-non-null-assertion": "warn",
170
+ "@typescript-eslint/no-redundant-type-constituents": "warn",
171
+ "@typescript-eslint/no-require-imports": "warn",
172
+ /** Disabled since this rule is intended to be used for project-specific types. */
173
+ "@typescript-eslint/no-restricted-types": "off",
174
+ "@typescript-eslint/no-this-alias": "warn",
175
+ /** Disabled because this rule is deprecated. */
176
+ "@typescript-eslint/no-type-alias": "off",
177
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
178
+ "@typescript-eslint/no-unnecessary-condition": "warn",
179
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": "warn",
180
+ "@typescript-eslint/no-unnecessary-qualifier": "warn",
181
+ "@typescript-eslint/no-unnecessary-template-expression": "warn",
182
+ "@typescript-eslint/no-unnecessary-type-arguments": "warn",
183
+ "@typescript-eslint/no-unnecessary-type-assertion": "warn",
184
+ "@typescript-eslint/no-unnecessary-type-constraint": "warn",
185
+ "@typescript-eslint/no-unnecessary-type-parameters": "warn",
186
+ "@typescript-eslint/no-unsafe-argument": "warn",
187
+ "@typescript-eslint/no-unsafe-assignment": "warn",
188
+ "@typescript-eslint/no-unsafe-call": "warn",
189
+ "@typescript-eslint/no-unsafe-declaration-merging": "warn",
190
+ "@typescript-eslint/no-unsafe-enum-comparison": "warn",
191
+ "@typescript-eslint/no-unsafe-function-type": "warn",
192
+ "@typescript-eslint/no-unsafe-member-access": "warn",
193
+ "@typescript-eslint/no-unsafe-return": "warn",
194
+ "@typescript-eslint/no-unsafe-unary-minus": "warn",
195
+ "@typescript-eslint/no-useless-empty-export": "warn",
196
+ "@typescript-eslint/no-var-requires": "warn",
197
+ "@typescript-eslint/no-wrapper-object-types": "warn",
198
+ "@typescript-eslint/non-nullable-type-assertion-style": "warn",
199
+ "@typescript-eslint/only-throw-error": "warn",
200
+ "@typescript-eslint/parameter-properties": "warn",
201
+ "@typescript-eslint/prefer-as-const": "warn",
202
+ /**
203
+ * Object destructuring is enforced but array destructuring is not. This matches usage in the
204
+ * general TypeScript ecosystem.
205
+ */
206
+ "@typescript-eslint/prefer-destructuring": [
207
+ "warn",
208
+ {
209
+ VariableDeclarator: {
210
+ array: false,
211
+ object: true,
212
+ },
213
+ AssignmentExpression: {
214
+ array: false,
215
+ object: true,
216
+ },
217
+ },
218
+ {
219
+ // We disable this for renamed properties, since code like the following should be valid:
220
+ // `const someSpecificMyEnum = MyEnum.Value1;`
221
+ enforceForRenamedProperties: false,
222
+ },
223
+ ],
224
+ "@typescript-eslint/prefer-enum-initializers": "warn",
225
+ "@typescript-eslint/prefer-find": "warn",
226
+ "@typescript-eslint/prefer-for-of": "warn",
227
+ "@typescript-eslint/prefer-function-type": "warn",
228
+ "@typescript-eslint/prefer-includes": "warn",
229
+ "@typescript-eslint/prefer-literal-enum-member": "warn",
230
+ "@typescript-eslint/prefer-namespace-keyword": "warn",
231
+ "@typescript-eslint/prefer-nullish-coalescing": "warn",
232
+ /**
233
+ * Disabled because it can modify the type of `boolean` declarations, which is [undesired in
234
+ * some
235
+ * circumstances](https://github.com/typescript-eslint/typescript-eslint/issues/5269).
236
+ */
237
+ "@typescript-eslint/prefer-optional-chain": "off",
238
+ "@typescript-eslint/prefer-readonly": "warn",
239
+ /** Superseded by the `complete/prefer-readonly-parameter-types` rule. */
240
+ "@typescript-eslint/prefer-readonly-parameter-types": "off",
241
+ "@typescript-eslint/prefer-reduce-type-parameter": "warn",
242
+ /** Disabled since using the `String.match` form might make code easier to read. */
243
+ "@typescript-eslint/prefer-regexp-exec": "off",
244
+ "@typescript-eslint/prefer-return-this-type": "warn",
245
+ "@typescript-eslint/prefer-string-starts-ends-with": "warn",
246
+ "@typescript-eslint/prefer-ts-expect-error": "warn",
247
+ "@typescript-eslint/promise-function-async": "warn",
248
+ "@typescript-eslint/require-array-sort-compare": "warn",
249
+ /** The various "allow" options are disabled to make the rule stricter. */
250
+ "@typescript-eslint/restrict-plus-operands": [
251
+ "warn",
252
+ {
253
+ allowAny: false,
254
+ allowBoolean: false,
255
+ allowNullish: false,
256
+ allowNumberAndString: false,
257
+ allowRegExp: false,
258
+ },
259
+ ],
260
+ /**
261
+ * Disabled since a common use-case of template strings is to coerce everything to a string.
262
+ */
263
+ "@typescript-eslint/restrict-template-expressions": "off",
264
+ /** Disabled since in it does not make sense to sort a union alphabetically in many cases. */
265
+ "@typescript-eslint/sort-type-constituents": "off",
266
+ /** The `allowString` and `allowNumber` options are disabled to make the rule stricter. */
267
+ "@typescript-eslint/strict-boolean-expressions": [
268
+ "warn",
269
+ {
270
+ allowString: false,
271
+ allowNumber: false,
272
+ allowNullableObject: true,
273
+ allowNullableBoolean: false,
274
+ allowNullableString: false,
275
+ allowNullableNumber: false,
276
+ allowNullableEnum: false,
277
+ allowAny: false,
278
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
279
+ },
280
+ ],
281
+ /**
282
+ * The `allowDefaultCaseForExhaustiveSwitch` option is disabled and the
283
+ * `requireDefaultForNonUnion` option is enabled to make the rule stricter.
284
+ */
285
+ "@typescript-eslint/switch-exhaustiveness-check": [
286
+ "warn",
287
+ {
288
+ allowDefaultCaseForExhaustiveSwitch: false,
289
+ requireDefaultForNonUnion: true,
290
+ },
291
+ ],
292
+ "@typescript-eslint/triple-slash-reference": "warn",
293
+ "@typescript-eslint/type-annotation-spacing": "off", // eslint-config-prettier
294
+ /**
295
+ * Disabled since it is not recommended by the `typescript-eslint` team. (They recommend using
296
+ * the `noImplicitAny` and `strictPropertyInitialization` TypeScript compiler options
297
+ * instead.)
298
+ */
299
+ "@typescript-eslint/typedef": "off",
300
+ "@typescript-eslint/unbound-method": "warn",
301
+ "@typescript-eslint/unified-signatures": "warn",
302
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": "warn",
303
+ "@typescript-eslint/block-spacing": "off", // eslint-config-prettier
304
+ "@typescript-eslint/brace-style": "off", // eslint-config-prettier
305
+ "@typescript-eslint/class-methods-use-this": "warn",
306
+ "@typescript-eslint/comma-dangle": "off", // eslint-config-prettier
307
+ "@typescript-eslint/comma-spacing": "off", // eslint-config-prettier
308
+ /** Disabled since this is handled by the `noImplicitReturns` TypeScript compiler flag. */
309
+ "@typescript-eslint/consistent-return": "off",
310
+ "@typescript-eslint/default-param-last": "warn",
311
+ "@typescript-eslint/dot-notation": "warn",
312
+ "@typescript-eslint/func-call-spacing": "off", // eslint-config-prettier
313
+ "@typescript-eslint/indent": "off", // eslint-config-prettier
314
+ /**
315
+ * Disabled since it is superfluous to require an `= undefined` during variable initialization
316
+ * (and TypeScript will take care of the non-undefined cases).
317
+ */
318
+ "@typescript-eslint/init-declarations": "off",
319
+ "@typescript-eslint/key-spacing": "off", // eslint-config-prettier
320
+ "@typescript-eslint/keyword-spacing": "off", // eslint-config-prettier
321
+ "@typescript-eslint/no-array-constructor": "warn",
322
+ "@typescript-eslint/no-array-delete": "warn",
323
+ /**
324
+ * Disabled since it is superfluous when using TypeScript according to [the ESLint
325
+ * documentation](https://eslint.org/docs/latest/rules/no-dupe-class-members#when-not-to-use-it).
326
+ */
327
+ "@typescript-eslint/no-dupe-class-members": "off",
328
+ "@typescript-eslint/no-empty-function": "warn",
329
+ "@typescript-eslint/no-extra-parens": "off", // eslint-config-prettier
330
+ "@typescript-eslint/no-extra-semi": "off", // eslint-config-prettier
331
+ "@typescript-eslint/no-implied-eval": "warn",
332
+ /** The `capIsConstructor` option is disabled to make the rule stricter. */
333
+ "@typescript-eslint/no-invalid-this": [
334
+ "warn",
335
+ {
336
+ capIsConstructor: false,
337
+ },
338
+ ],
339
+ "@typescript-eslint/no-loop-func": "warn",
340
+ "@typescript-eslint/no-loss-of-precision": "warn",
341
+ /** Disabled since it results in too many false positives. */
342
+ "@typescript-eslint/no-magic-numbers": "off",
343
+ /**
344
+ * Disabled since it is handled by the combination of the TypeScript compiler and the `no-var`
345
+ * ESLint rule.
346
+ */
347
+ "@typescript-eslint/no-redeclare": "off",
348
+ /**
349
+ * Configured to prevent importing with some common patterns that are almost always a mistake:
350
+ *
351
+ * - "src" directories (but allowed in test files that are in a separate "tests" directory)
352
+ * - "dist" directories
353
+ * - "index" files (things in the same package should directly import instead of use the
354
+ * public API)
355
+ */
356
+ "@typescript-eslint/no-restricted-imports": [
357
+ "warn",
358
+ {
359
+ patterns: [
360
+ // Some "src" directories have an "index.ts" file, which means that importing from the
361
+ // directory is valid. Thus, we check for the "src" directory with no suffix.
362
+ {
363
+ group: ["**/src"],
364
+ message: 'You cannot import from a "src" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
365
+ },
366
+ {
367
+ group: ["**/src/**"],
368
+ message: 'You cannot import from a "src" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
369
+ },
370
+ // Some "dist" directories have an "index.ts" file, which means that importing from the
371
+ // directory is valid. Thus, we check for the "dist" directory with no suffix.
372
+ {
373
+ group: ["**/dist"],
374
+ message: 'You cannot import from a "dist" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
375
+ },
376
+ {
377
+ group: ["**/dist/**"],
378
+ message: 'You cannot import from a "dist" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
379
+ },
380
+ {
381
+ group: ["**/index"],
382
+ message: "You cannot import from a package index. Instead, import directly from the file where the code is located.",
383
+ },
384
+ {
385
+ group: ["**/index.{js,cjs,mjs,ts,cts,mts}"],
386
+ message: "You cannot import from a package index. Instead, import directly from the file where the code is located.",
387
+ },
388
+ ],
389
+ },
390
+ ],
391
+ "@typescript-eslint/no-shadow": "warn",
392
+ /**
393
+ * The `allowTaggedTemplates` option is enabled to allow the rule to work with libraries like
394
+ * `execa`.
395
+ */
396
+ "@typescript-eslint/no-unused-expressions": [
397
+ "warn",
398
+ {
399
+ allowTaggedTemplates: true,
400
+ },
401
+ ],
402
+ /**
403
+ * The `args` option is set to `all` make the rule stricter. Additionally, we ignore things
404
+ * that begin with an underscore, since this matches the behavior of the `--noUnusedLocals`
405
+ * TypeScript compiler flag.
406
+ */
407
+ "@typescript-eslint/no-unused-vars": [
408
+ "warn",
409
+ {
410
+ args: "all", // "after-used" is the default.
411
+ argsIgnorePattern: "^_",
412
+ varsIgnorePattern: "^_",
413
+ },
414
+ ],
415
+ /** Disabled because it can prevent code from being structured sequentially. */
416
+ "@typescript-eslint/no-use-before-define": "off",
417
+ "@typescript-eslint/no-useless-constructor": "warn",
418
+ "@typescript-eslint/object-curly-spacing": "off", // eslint-config-prettier
419
+ /**
420
+ * Disabled since it is for inserting extra newlines between specific kinds of statements,
421
+ * which would be project-dependant. (This kind of formatting is not handled by Prettier.)
422
+ */
423
+ "@typescript-eslint/padding-line-between-statements": "off",
424
+ /** The `allowEmptyReject` option is enabled since this is a common pattern. */
425
+ "@typescript-eslint/prefer-promise-reject-errors": [
426
+ "warn",
427
+ {
428
+ allowEmptyReject: true,
429
+ },
430
+ ],
431
+ "@typescript-eslint/require-await": "warn",
432
+ /**
433
+ * Even though the core rule was deprecated, the extended rule uses type information, so it is
434
+ * much better.
435
+ */
436
+ "@typescript-eslint/return-await": "warn",
437
+ "@typescript-eslint/semi": "off", // eslint-config-prettier
438
+ "@typescript-eslint/space-before-blocks": "off", // eslint-config-prettier
439
+ "@typescript-eslint/space-before-function-paren": "off", // eslint-config-prettier
440
+ "@typescript-eslint/space-infix-ops": "off", // eslint-config-prettier
441
+ },
442
+ },
443
+ // Enable linting on TypeScript file extensions.
444
+ {
445
+ files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
446
+ },
447
+ // Disable some TypeScript-specific rules in JavaScript files.
448
+ {
449
+ files: ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.jsx"],
450
+ rules: {
451
+ "@typescript-eslint/explicit-module-boundary-types": "off",
452
+ "@typescript-eslint/no-require-imports": "off",
453
+ "@typescript-eslint/no-unsafe-argument": "off",
454
+ "@typescript-eslint/no-unsafe-assignment": "off",
455
+ "@typescript-eslint/no-unsafe-call": "off",
456
+ "@typescript-eslint/no-unsafe-member-access": "off",
457
+ "@typescript-eslint/no-unsafe-return": "off",
458
+ "@typescript-eslint/no-var-requires": "off",
459
+ "@typescript-eslint/strict-boolean-expressions": "off",
460
+ },
461
+ },
462
+ // The built-in Node.js test-runner returns a promise which is not meant to be awaited.
463
+ {
464
+ files: ["**/*.test.{js,cjs,mjs,ts,cts,mts}"],
465
+ rules: {
466
+ "@typescript-eslint/no-floating-promises": "off",
467
+ },
468
+ },
469
+ // We want to be allowed to import from the "src" directory in test files that are located in a
470
+ // separate "tests" directory.
471
+ {
472
+ files: ["**/tests/**"],
473
+ rules: {
474
+ "@typescript-eslint/no-restricted-imports": "off",
475
+ },
476
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This ESLint config only contains rules from `eslint-plugin-unicorn`:
3
+ * https://github.com/sindresorhus/eslint-plugin-unicorn
4
+ *
5
+ * Rules are separated into categories:
6
+ * 1) Normal rules
7
+ * 2) Deprecated rules
8
+ */
9
+ export const baseUnicorn: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
10
+ //# sourceMappingURL=base-unicorn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-unicorn.d.ts","sourceRoot":"","sources":["../../src/base/base-unicorn.js"],"names":[],"mappings":"AAoOA;;;;;;;GAOG;AACH,8FASG"}