eslint-config-complete 1.2.2 → 1.2.4

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