@jimmy.codes/eslint-config 7.5.3 → 7.6.1
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/dist/globs.d.mts +2 -1
- package/dist/globs.mjs +2 -1
- package/dist/index.d.mts +174 -145
- package/dist/index.mjs +3 -3
- package/dist/{nextjs-Buyxv06i.mjs → nextjs-Dq5nQ9ib.mjs} +4 -1
- package/dist/{react-C7mZF3Qf.mjs → react-CWFVE51B.mjs} +8 -3
- package/dist/{tanstack-query-CfY9r6o6.mjs → tanstack-query-ntNKBb-Z.mjs} +1 -0
- package/package.json +9 -9
package/dist/globs.d.mts
CHANGED
|
@@ -10,6 +10,7 @@ declare const GLOB_TYPE_TESTS: readonly ["**/*.test-d.?([cm])ts", "**/*.test-d.?
|
|
|
10
10
|
declare const GLOB_PLAYWRIGHT: readonly ["**/e2e/**/*.spec.?([cm])[jt]s?(x)", "**/e2e/**/*.test.?([cm])[jt]s?(x)"];
|
|
11
11
|
declare const GLOB_E2E: readonly ["**/e2e/**/*.spec.?([cm])[jt]s?(x)", "**/e2e/**/*.test.?([cm])[jt]s?(x)", "**/cypress/**/*.spec.?([cm])[jt]s?(x)", "**/cypress/**/*.test.?([cm])[jt]s?(x)"];
|
|
12
12
|
declare const GLOB_NEXTJS: readonly ["**/*.?([cm])js", "**/*.?([cm])jsx", "**/*.?([cm])ts", "**/*.?([cm])tsx"];
|
|
13
|
+
declare const GLOB_NEXTJS_ENV: readonly ["**/next-env.d.ts"];
|
|
13
14
|
declare const GLOB_IGNORES: readonly ["**/node_modules", "**/dist", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/bun.lockb", "**/output", "**/coverage", "**/temp", "**/.temp", "**/tmp", "**/.tmp", "**/.history", "**/.vitepress/cache", "**/.nuxt", "**/.next", "**/.vercel", "**/.changeset", "**/.idea", "**/.cache", "**/.output", "**/.vite-inspect", "**/.yarn", "**/storybook-static", "**/.eslint-config-inspector", "**/playwright-report", "**/.astro", "**/.vinxi", "**/app.config.timestamp_*.js", "**/.tanstack", "**/.nitro", "**/CHANGELOG*.md", "**/*.min.*", "**/LICENSE*", "**/__snapshots__", "**/auto-import?(s).d.ts", "**/components.d.ts", "**/vite.config.ts.*.mjs", "**/*.gen.*", "!.storybook"];
|
|
14
15
|
//#endregion
|
|
15
|
-
export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_TYPE_TESTS };
|
|
16
|
+
export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_NEXTJS_ENV, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_TYPE_TESTS };
|
package/dist/globs.mjs
CHANGED
|
@@ -33,6 +33,7 @@ const GLOB_NEXTJS = [
|
|
|
33
33
|
GLOB_TS,
|
|
34
34
|
GLOB_TSX
|
|
35
35
|
];
|
|
36
|
+
const GLOB_NEXTJS_ENV = ["**/next-env.d.ts"];
|
|
36
37
|
const GLOB_IGNORES = [
|
|
37
38
|
"**/node_modules",
|
|
38
39
|
"**/dist",
|
|
@@ -76,4 +77,4 @@ const GLOB_IGNORES = [
|
|
|
76
77
|
"!.storybook"
|
|
77
78
|
];
|
|
78
79
|
//#endregion
|
|
79
|
-
export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_TYPE_TESTS };
|
|
80
|
+
export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_NEXTJS_ENV, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_TYPE_TESTS };
|
package/dist/index.d.mts
CHANGED
|
@@ -670,6 +670,11 @@ interface RuleOptions {
|
|
|
670
670
|
* @see https://tanstack.com/query/latest/docs/eslint/no-void-query-fn
|
|
671
671
|
*/
|
|
672
672
|
'@tanstack/query/no-void-query-fn'?: Linter.RuleEntry<[]>;
|
|
673
|
+
/**
|
|
674
|
+
* Prefer using queryOptions() to co-locate queryKey and queryFn
|
|
675
|
+
* @see https://tanstack.com/query/latest/docs/eslint/prefer-query-options
|
|
676
|
+
*/
|
|
677
|
+
'@tanstack/query/prefer-query-options'?: Linter.RuleEntry<[]>;
|
|
673
678
|
/**
|
|
674
679
|
* Makes sure that QueryClient is stable
|
|
675
680
|
* @see https://tanstack.com/query/latest/docs/eslint/stable-query-client
|
|
@@ -6244,730 +6249,750 @@ interface RuleOptions {
|
|
|
6244
6249
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
6245
6250
|
/**
|
|
6246
6251
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
6247
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6252
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/better-regex.md
|
|
6248
6253
|
*/
|
|
6249
6254
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>;
|
|
6250
6255
|
/**
|
|
6251
6256
|
* Enforce a specific parameter name in catch clauses.
|
|
6252
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6257
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/catch-error-name.md
|
|
6253
6258
|
*/
|
|
6254
6259
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
6255
6260
|
/**
|
|
6256
6261
|
* Enforce consistent assertion style with `node:assert`.
|
|
6257
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6262
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/consistent-assert.md
|
|
6258
6263
|
*/
|
|
6259
6264
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
6260
6265
|
/**
|
|
6261
6266
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
6262
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6267
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/consistent-date-clone.md
|
|
6263
6268
|
*/
|
|
6264
6269
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
6265
6270
|
/**
|
|
6266
6271
|
* Use destructured variables over properties.
|
|
6267
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6272
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/consistent-destructuring.md
|
|
6268
6273
|
*/
|
|
6269
6274
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
6270
6275
|
/**
|
|
6271
6276
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
6272
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6277
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/consistent-empty-array-spread.md
|
|
6273
6278
|
*/
|
|
6274
6279
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
6275
6280
|
/**
|
|
6276
6281
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
6277
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6282
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/consistent-existence-index-check.md
|
|
6278
6283
|
*/
|
|
6279
6284
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
6280
6285
|
/**
|
|
6281
6286
|
* Move function definitions to the highest possible scope.
|
|
6282
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6287
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/consistent-function-scoping.md
|
|
6283
6288
|
*/
|
|
6284
6289
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
6290
|
+
/**
|
|
6291
|
+
* Enforce consistent style for escaping `${` in template literals.
|
|
6292
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/consistent-template-literal-escape.md
|
|
6293
|
+
*/
|
|
6294
|
+
'unicorn/consistent-template-literal-escape'?: Linter.RuleEntry<[]>;
|
|
6285
6295
|
/**
|
|
6286
6296
|
* Enforce correct `Error` subclassing.
|
|
6287
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6297
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/custom-error-definition.md
|
|
6288
6298
|
*/
|
|
6289
6299
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
6290
6300
|
/**
|
|
6291
6301
|
* Enforce no spaces between braces.
|
|
6292
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6302
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/empty-brace-spaces.md
|
|
6293
6303
|
*/
|
|
6294
6304
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
6295
6305
|
/**
|
|
6296
6306
|
* Enforce passing a `message` value when creating a built-in error.
|
|
6297
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6307
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/error-message.md
|
|
6298
6308
|
*/
|
|
6299
6309
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
6300
6310
|
/**
|
|
6301
6311
|
* Require escape sequences to use uppercase or lowercase values.
|
|
6302
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6312
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/escape-case.md
|
|
6303
6313
|
*/
|
|
6304
6314
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
6305
6315
|
/**
|
|
6306
6316
|
* Add expiration conditions to TODO comments.
|
|
6307
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6317
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/expiring-todo-comments.md
|
|
6308
6318
|
*/
|
|
6309
6319
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
6310
6320
|
/**
|
|
6311
6321
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
6312
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6322
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/explicit-length-check.md
|
|
6313
6323
|
*/
|
|
6314
6324
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
6315
6325
|
/**
|
|
6316
6326
|
* Enforce a case style for filenames.
|
|
6317
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6327
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/filename-case.md
|
|
6318
6328
|
*/
|
|
6319
6329
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
6320
6330
|
/**
|
|
6321
6331
|
* Enforce specific import styles per module.
|
|
6322
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6332
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/import-style.md
|
|
6323
6333
|
*/
|
|
6324
6334
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
6325
6335
|
/**
|
|
6326
6336
|
* Prevent usage of variables from outside the scope of isolated functions.
|
|
6327
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6337
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/isolated-functions.md
|
|
6328
6338
|
*/
|
|
6329
6339
|
'unicorn/isolated-functions'?: Linter.RuleEntry<UnicornIsolatedFunctions>;
|
|
6330
6340
|
/**
|
|
6331
6341
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
6332
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6342
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/new-for-builtins.md
|
|
6333
6343
|
*/
|
|
6334
6344
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
6335
6345
|
/**
|
|
6336
6346
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
6337
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6347
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
6338
6348
|
*/
|
|
6339
6349
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
6340
6350
|
/**
|
|
6341
6351
|
* Disallow recursive access to `this` within getters and setters.
|
|
6342
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6352
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-accessor-recursion.md
|
|
6343
6353
|
*/
|
|
6344
6354
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
6345
6355
|
/**
|
|
6346
6356
|
* Disallow anonymous functions and classes as the default export.
|
|
6347
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6357
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-anonymous-default-export.md
|
|
6348
6358
|
*/
|
|
6349
6359
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
6350
6360
|
/**
|
|
6351
6361
|
* Prevent passing a function reference directly to iterator methods.
|
|
6352
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6362
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-array-callback-reference.md
|
|
6353
6363
|
*/
|
|
6354
6364
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>;
|
|
6355
6365
|
/**
|
|
6356
6366
|
* Prefer `for…of` over the `forEach` method.
|
|
6357
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6367
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-array-for-each.md
|
|
6358
6368
|
*/
|
|
6359
6369
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
6360
6370
|
/**
|
|
6361
6371
|
* Disallow using the `this` argument in array methods.
|
|
6362
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6372
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-array-method-this-argument.md
|
|
6363
6373
|
*/
|
|
6364
6374
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
6365
6375
|
/**
|
|
6366
6376
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
6367
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6377
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/deleted-and-deprecated-rules.md#no-array-push-push
|
|
6368
6378
|
* @deprecated
|
|
6369
6379
|
*/
|
|
6370
6380
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
6371
6381
|
/**
|
|
6372
6382
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
6373
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6383
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-array-reduce.md
|
|
6374
6384
|
*/
|
|
6375
6385
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
6376
6386
|
/**
|
|
6377
6387
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
6378
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6388
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-array-reverse.md
|
|
6379
6389
|
*/
|
|
6380
6390
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
6381
6391
|
/**
|
|
6382
6392
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
6383
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6393
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-array-sort.md
|
|
6384
6394
|
*/
|
|
6385
6395
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
6386
6396
|
/**
|
|
6387
6397
|
* Disallow member access from await expression.
|
|
6388
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6398
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-await-expression-member.md
|
|
6389
6399
|
*/
|
|
6390
6400
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
6391
6401
|
/**
|
|
6392
6402
|
* Disallow using `await` in `Promise` method parameters.
|
|
6393
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6403
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-await-in-promise-methods.md
|
|
6394
6404
|
*/
|
|
6395
6405
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6396
6406
|
/**
|
|
6397
6407
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
6398
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6408
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-console-spaces.md
|
|
6399
6409
|
*/
|
|
6400
6410
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
6401
6411
|
/**
|
|
6402
6412
|
* Do not use `document.cookie` directly.
|
|
6403
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6413
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-document-cookie.md
|
|
6404
6414
|
*/
|
|
6405
6415
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
6406
6416
|
/**
|
|
6407
6417
|
* Disallow empty files.
|
|
6408
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6418
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-empty-file.md
|
|
6409
6419
|
*/
|
|
6410
6420
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>;
|
|
6411
6421
|
/**
|
|
6412
6422
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
6413
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6423
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-for-loop.md
|
|
6414
6424
|
*/
|
|
6415
6425
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
6416
6426
|
/**
|
|
6417
6427
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
6418
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6428
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-hex-escape.md
|
|
6419
6429
|
*/
|
|
6420
6430
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
6421
6431
|
/**
|
|
6422
6432
|
* Disallow immediate mutation after variable assignment.
|
|
6423
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6433
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-immediate-mutation.md
|
|
6424
6434
|
*/
|
|
6425
6435
|
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>;
|
|
6426
6436
|
/**
|
|
6427
6437
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
6428
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6438
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/deleted-and-deprecated-rules.md#no-instanceof-array
|
|
6429
6439
|
* @deprecated
|
|
6430
6440
|
*/
|
|
6431
6441
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
6432
6442
|
/**
|
|
6433
6443
|
* Disallow `instanceof` with built-in objects
|
|
6434
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6444
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-instanceof-builtins.md
|
|
6435
6445
|
*/
|
|
6436
6446
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
6437
6447
|
/**
|
|
6438
6448
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
6439
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6449
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-invalid-fetch-options.md
|
|
6440
6450
|
*/
|
|
6441
6451
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
6442
6452
|
/**
|
|
6443
6453
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
6444
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6454
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
6445
6455
|
*/
|
|
6446
6456
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
6447
6457
|
/**
|
|
6448
6458
|
* Disallow identifiers starting with `new` or `class`.
|
|
6449
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6459
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-keyword-prefix.md
|
|
6450
6460
|
*/
|
|
6451
6461
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
6452
6462
|
/**
|
|
6453
6463
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
6454
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6464
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/deleted-and-deprecated-rules.md#no-length-as-slice-end
|
|
6455
6465
|
* @deprecated
|
|
6456
6466
|
*/
|
|
6457
6467
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
6458
6468
|
/**
|
|
6459
6469
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
6460
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6470
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-lonely-if.md
|
|
6461
6471
|
*/
|
|
6462
6472
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
6463
6473
|
/**
|
|
6464
6474
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
6465
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6475
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
6466
6476
|
*/
|
|
6467
6477
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6468
6478
|
/**
|
|
6469
6479
|
* Disallow named usage of default import and export.
|
|
6470
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6480
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-named-default.md
|
|
6471
6481
|
*/
|
|
6472
6482
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
6473
6483
|
/**
|
|
6474
6484
|
* Disallow negated conditions.
|
|
6475
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6485
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-negated-condition.md
|
|
6476
6486
|
*/
|
|
6477
6487
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
6478
6488
|
/**
|
|
6479
6489
|
* Disallow negated expression in equality check.
|
|
6480
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6490
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-negation-in-equality-check.md
|
|
6481
6491
|
*/
|
|
6482
6492
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
6483
6493
|
/**
|
|
6484
6494
|
* Disallow nested ternary expressions.
|
|
6485
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6495
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-nested-ternary.md
|
|
6486
6496
|
*/
|
|
6487
6497
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
6488
6498
|
/**
|
|
6489
6499
|
* Disallow `new Array()`.
|
|
6490
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6500
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-new-array.md
|
|
6491
6501
|
*/
|
|
6492
6502
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
6493
6503
|
/**
|
|
6494
6504
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
6495
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6505
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-new-buffer.md
|
|
6496
6506
|
*/
|
|
6497
6507
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
6498
6508
|
/**
|
|
6499
6509
|
* Disallow the use of the `null` literal.
|
|
6500
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6510
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-null.md
|
|
6501
6511
|
*/
|
|
6502
6512
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
6503
6513
|
/**
|
|
6504
6514
|
* Disallow the use of objects as default parameters.
|
|
6505
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6515
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-object-as-default-parameter.md
|
|
6506
6516
|
*/
|
|
6507
6517
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
6508
6518
|
/**
|
|
6509
6519
|
* Disallow `process.exit()`.
|
|
6510
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6520
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-process-exit.md
|
|
6511
6521
|
*/
|
|
6512
6522
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
6513
6523
|
/**
|
|
6514
6524
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
6515
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6525
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
6516
6526
|
*/
|
|
6517
6527
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6518
6528
|
/**
|
|
6519
6529
|
* Disallow classes that only have static members.
|
|
6520
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6530
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-static-only-class.md
|
|
6521
6531
|
*/
|
|
6522
6532
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
6523
6533
|
/**
|
|
6524
6534
|
* Disallow `then` property.
|
|
6525
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6535
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-thenable.md
|
|
6526
6536
|
*/
|
|
6527
6537
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
6528
6538
|
/**
|
|
6529
6539
|
* Disallow assigning `this` to a variable.
|
|
6530
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6540
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-this-assignment.md
|
|
6531
6541
|
*/
|
|
6532
6542
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
6533
6543
|
/**
|
|
6534
6544
|
* Disallow comparing `undefined` using `typeof`.
|
|
6535
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6545
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-typeof-undefined.md
|
|
6536
6546
|
*/
|
|
6537
6547
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
6538
6548
|
/**
|
|
6539
6549
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
6540
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6550
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
6541
6551
|
*/
|
|
6542
6552
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6543
6553
|
/**
|
|
6544
6554
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
6545
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6555
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
6546
6556
|
*/
|
|
6547
6557
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
6548
6558
|
/**
|
|
6549
6559
|
* Disallow awaiting non-promise values.
|
|
6550
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6560
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-unnecessary-await.md
|
|
6551
6561
|
*/
|
|
6552
6562
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
6553
6563
|
/**
|
|
6554
6564
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
6555
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6565
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
6556
6566
|
*/
|
|
6557
6567
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
6558
6568
|
/**
|
|
6559
6569
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
6560
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6570
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
6561
6571
|
*/
|
|
6562
6572
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
6563
6573
|
/**
|
|
6564
6574
|
* Disallow unreadable array destructuring.
|
|
6565
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6575
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
6566
6576
|
*/
|
|
6567
6577
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
6568
6578
|
/**
|
|
6569
6579
|
* Disallow unreadable IIFEs.
|
|
6570
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6580
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-unreadable-iife.md
|
|
6571
6581
|
*/
|
|
6572
6582
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
6573
6583
|
/**
|
|
6574
6584
|
* Disallow unused object properties.
|
|
6575
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6585
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-unused-properties.md
|
|
6576
6586
|
*/
|
|
6577
6587
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
6578
6588
|
/**
|
|
6579
6589
|
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
6580
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6590
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-useless-collection-argument.md
|
|
6581
6591
|
*/
|
|
6582
6592
|
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>;
|
|
6583
6593
|
/**
|
|
6584
6594
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
6585
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6595
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
6586
6596
|
*/
|
|
6587
6597
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
6588
6598
|
/**
|
|
6589
6599
|
* Disallow useless fallback when spreading in object literals.
|
|
6590
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6600
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
6591
6601
|
*/
|
|
6592
6602
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
6603
|
+
/**
|
|
6604
|
+
* Disallow unnecessary `.toArray()` on iterators.
|
|
6605
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-useless-iterator-to-array.md
|
|
6606
|
+
*/
|
|
6607
|
+
'unicorn/no-useless-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
6593
6608
|
/**
|
|
6594
6609
|
* Disallow useless array length check.
|
|
6595
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6610
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-useless-length-check.md
|
|
6596
6611
|
*/
|
|
6597
6612
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
6598
6613
|
/**
|
|
6599
6614
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
6600
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6615
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
6601
6616
|
*/
|
|
6602
6617
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
6603
6618
|
/**
|
|
6604
6619
|
* Disallow unnecessary spread.
|
|
6605
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6620
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-useless-spread.md
|
|
6606
6621
|
*/
|
|
6607
6622
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
6608
6623
|
/**
|
|
6609
6624
|
* Disallow useless case in switch statements.
|
|
6610
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6625
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-useless-switch-case.md
|
|
6611
6626
|
*/
|
|
6612
6627
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
6613
6628
|
/**
|
|
6614
6629
|
* Disallow useless `undefined`.
|
|
6615
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6630
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-useless-undefined.md
|
|
6616
6631
|
*/
|
|
6617
6632
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
6618
6633
|
/**
|
|
6619
6634
|
* Disallow number literals with zero fractions or dangling dots.
|
|
6620
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6635
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/no-zero-fractions.md
|
|
6621
6636
|
*/
|
|
6622
6637
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
6623
6638
|
/**
|
|
6624
6639
|
* Enforce proper case for numeric literals.
|
|
6625
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6640
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/number-literal-case.md
|
|
6626
6641
|
*/
|
|
6627
6642
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
6628
6643
|
/**
|
|
6629
6644
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
6630
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6645
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/numeric-separators-style.md
|
|
6631
6646
|
*/
|
|
6632
6647
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
6633
6648
|
/**
|
|
6634
6649
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
6635
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6650
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-add-event-listener.md
|
|
6636
6651
|
*/
|
|
6637
6652
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
6638
6653
|
/**
|
|
6639
6654
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
6640
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6655
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-array-find.md
|
|
6641
6656
|
*/
|
|
6642
6657
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
6643
6658
|
/**
|
|
6644
6659
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
6645
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6660
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-array-flat.md
|
|
6646
6661
|
*/
|
|
6647
6662
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
6648
6663
|
/**
|
|
6649
6664
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
6650
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6665
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-array-flat-map.md
|
|
6651
6666
|
*/
|
|
6652
6667
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
6653
6668
|
/**
|
|
6654
6669
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
6655
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6670
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-array-index-of.md
|
|
6656
6671
|
*/
|
|
6657
6672
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
6658
6673
|
/**
|
|
6659
6674
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
6660
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6675
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-array-some.md
|
|
6661
6676
|
*/
|
|
6662
6677
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
6663
6678
|
/**
|
|
6664
6679
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
6665
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6680
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-at.md
|
|
6666
6681
|
*/
|
|
6667
6682
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
6668
6683
|
/**
|
|
6669
6684
|
* Prefer `BigInt` literals over the constructor.
|
|
6670
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6685
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-bigint-literals.md
|
|
6671
6686
|
*/
|
|
6672
6687
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
6673
6688
|
/**
|
|
6674
6689
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
6675
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6690
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
6676
6691
|
*/
|
|
6677
6692
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
6678
6693
|
/**
|
|
6679
6694
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
6680
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6695
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-class-fields.md
|
|
6681
6696
|
*/
|
|
6682
6697
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
6683
6698
|
/**
|
|
6684
6699
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
6685
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6700
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-classlist-toggle.md
|
|
6686
6701
|
*/
|
|
6687
6702
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
6688
6703
|
/**
|
|
6689
6704
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
6690
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6705
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-code-point.md
|
|
6691
6706
|
*/
|
|
6692
6707
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
6693
6708
|
/**
|
|
6694
6709
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
6695
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6710
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-date-now.md
|
|
6696
6711
|
*/
|
|
6697
6712
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
6698
6713
|
/**
|
|
6699
6714
|
* Prefer default parameters over reassignment.
|
|
6700
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6715
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-default-parameters.md
|
|
6701
6716
|
*/
|
|
6702
6717
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
6703
6718
|
/**
|
|
6704
6719
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
6705
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6720
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-dom-node-append.md
|
|
6706
6721
|
*/
|
|
6707
6722
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
6708
6723
|
/**
|
|
6709
6724
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
6710
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6725
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-dom-node-dataset.md
|
|
6711
6726
|
*/
|
|
6712
6727
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
6713
6728
|
/**
|
|
6714
6729
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
6715
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6730
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-dom-node-remove.md
|
|
6716
6731
|
*/
|
|
6717
6732
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
6718
6733
|
/**
|
|
6719
6734
|
* Prefer `.textContent` over `.innerText`.
|
|
6720
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6735
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
6721
6736
|
*/
|
|
6722
6737
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
6723
6738
|
/**
|
|
6724
6739
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
6725
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6740
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-event-target.md
|
|
6726
6741
|
*/
|
|
6727
6742
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
6728
6743
|
/**
|
|
6729
6744
|
* Prefer `export…from` when re-exporting.
|
|
6730
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6745
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-export-from.md
|
|
6731
6746
|
*/
|
|
6732
6747
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
6733
6748
|
/**
|
|
6734
6749
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
6735
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6750
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-global-this.md
|
|
6736
6751
|
*/
|
|
6737
6752
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
6738
6753
|
/**
|
|
6739
6754
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
6740
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6755
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-import-meta-properties.md
|
|
6741
6756
|
*/
|
|
6742
6757
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
6743
6758
|
/**
|
|
6744
6759
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
6745
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6760
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-includes.md
|
|
6746
6761
|
*/
|
|
6747
6762
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
6748
6763
|
/**
|
|
6749
6764
|
* Prefer reading a JSON file as a buffer.
|
|
6750
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6765
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-json-parse-buffer.md
|
|
6751
6766
|
*/
|
|
6752
6767
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
6753
6768
|
/**
|
|
6754
6769
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
6755
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6770
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
6756
6771
|
*/
|
|
6757
6772
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
6758
6773
|
/**
|
|
6759
6774
|
* Prefer using a logical operator over a ternary.
|
|
6760
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6775
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
6761
6776
|
*/
|
|
6762
6777
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
6763
6778
|
/**
|
|
6764
6779
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
6765
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6780
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-math-min-max.md
|
|
6766
6781
|
*/
|
|
6767
6782
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
6768
6783
|
/**
|
|
6769
6784
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
6770
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6785
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-math-trunc.md
|
|
6771
6786
|
*/
|
|
6772
6787
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
6773
6788
|
/**
|
|
6774
6789
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
6775
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6790
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
6776
6791
|
*/
|
|
6777
6792
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
6778
6793
|
/**
|
|
6779
6794
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
6780
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6795
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-modern-math-apis.md
|
|
6781
6796
|
*/
|
|
6782
6797
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
6783
6798
|
/**
|
|
6784
6799
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
6785
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6800
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-module.md
|
|
6786
6801
|
*/
|
|
6787
6802
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
6788
6803
|
/**
|
|
6789
6804
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
6790
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6805
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
6791
6806
|
*/
|
|
6792
6807
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
6793
6808
|
/**
|
|
6794
6809
|
* Prefer negative index over `.length - index` when possible.
|
|
6795
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6810
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-negative-index.md
|
|
6796
6811
|
*/
|
|
6797
6812
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
6798
6813
|
/**
|
|
6799
6814
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
6800
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6815
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-node-protocol.md
|
|
6801
6816
|
*/
|
|
6802
6817
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
6803
6818
|
/**
|
|
6804
6819
|
* Prefer `Number` static properties over global ones.
|
|
6805
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6820
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-number-properties.md
|
|
6806
6821
|
*/
|
|
6807
6822
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
6808
6823
|
/**
|
|
6809
6824
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
6810
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6825
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-object-from-entries.md
|
|
6811
6826
|
*/
|
|
6812
6827
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
6813
6828
|
/**
|
|
6814
6829
|
* Prefer omitting the `catch` binding parameter.
|
|
6815
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6830
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
6816
6831
|
*/
|
|
6817
6832
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
6818
6833
|
/**
|
|
6819
6834
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
6820
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6835
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-prototype-methods.md
|
|
6821
6836
|
*/
|
|
6822
6837
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
6823
6838
|
/**
|
|
6824
6839
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
6825
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6840
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-query-selector.md
|
|
6826
6841
|
*/
|
|
6827
6842
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>;
|
|
6828
6843
|
/**
|
|
6829
6844
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
6830
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6845
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-reflect-apply.md
|
|
6831
6846
|
*/
|
|
6832
6847
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
6833
6848
|
/**
|
|
6834
6849
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
6835
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6850
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-regexp-test.md
|
|
6836
6851
|
*/
|
|
6837
6852
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
6838
6853
|
/**
|
|
6839
6854
|
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
6840
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6855
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-response-static-json.md
|
|
6841
6856
|
*/
|
|
6842
6857
|
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>;
|
|
6843
6858
|
/**
|
|
6844
6859
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
6845
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6860
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-set-has.md
|
|
6846
6861
|
*/
|
|
6847
6862
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>;
|
|
6848
6863
|
/**
|
|
6849
6864
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
6850
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6865
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-set-size.md
|
|
6851
6866
|
*/
|
|
6852
6867
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
6868
|
+
/**
|
|
6869
|
+
* Prefer simple conditions first in logical expressions.
|
|
6870
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-simple-condition-first.md
|
|
6871
|
+
*/
|
|
6872
|
+
'unicorn/prefer-simple-condition-first'?: Linter.RuleEntry<[]>;
|
|
6853
6873
|
/**
|
|
6854
6874
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
6855
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6875
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-single-call.md
|
|
6856
6876
|
*/
|
|
6857
6877
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
6858
6878
|
/**
|
|
6859
6879
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
6860
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6880
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-spread.md
|
|
6861
6881
|
*/
|
|
6862
6882
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
6863
6883
|
/**
|
|
6864
6884
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
6865
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6885
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-string-raw.md
|
|
6866
6886
|
*/
|
|
6867
6887
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
6868
6888
|
/**
|
|
6869
6889
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
6870
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6890
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-string-replace-all.md
|
|
6871
6891
|
*/
|
|
6872
6892
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
6873
6893
|
/**
|
|
6874
6894
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
6875
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6895
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-string-slice.md
|
|
6876
6896
|
*/
|
|
6877
6897
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
6878
6898
|
/**
|
|
6879
6899
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
6880
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6900
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
6881
6901
|
*/
|
|
6882
6902
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
6883
6903
|
/**
|
|
6884
6904
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
6885
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6905
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
6886
6906
|
*/
|
|
6887
6907
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
6888
6908
|
/**
|
|
6889
6909
|
* Prefer using `structuredClone` to create a deep clone.
|
|
6890
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6910
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-structured-clone.md
|
|
6891
6911
|
*/
|
|
6892
6912
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
6893
6913
|
/**
|
|
6894
6914
|
* Prefer `switch` over multiple `else-if`.
|
|
6895
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6915
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-switch.md
|
|
6896
6916
|
*/
|
|
6897
6917
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
6898
6918
|
/**
|
|
6899
6919
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
6900
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6920
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-ternary.md
|
|
6901
6921
|
*/
|
|
6902
6922
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
6903
6923
|
/**
|
|
6904
6924
|
* Prefer top-level await over top-level promises and async function calls.
|
|
6905
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6925
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-top-level-await.md
|
|
6906
6926
|
*/
|
|
6907
6927
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
6908
6928
|
/**
|
|
6909
6929
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
6910
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6930
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prefer-type-error.md
|
|
6911
6931
|
*/
|
|
6912
6932
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
6913
6933
|
/**
|
|
6914
6934
|
* Prevent abbreviations.
|
|
6915
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6935
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/prevent-abbreviations.md
|
|
6916
6936
|
*/
|
|
6917
6937
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
6918
6938
|
/**
|
|
6919
6939
|
* Enforce consistent relative URL style.
|
|
6920
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6940
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/relative-url-style.md
|
|
6921
6941
|
*/
|
|
6922
6942
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
6923
6943
|
/**
|
|
6924
6944
|
* Enforce using the separator argument with `Array#join()`.
|
|
6925
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6945
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/require-array-join-separator.md
|
|
6926
6946
|
*/
|
|
6927
6947
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
6928
6948
|
/**
|
|
6929
6949
|
* Require non-empty module attributes for imports and exports
|
|
6930
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6950
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/require-module-attributes.md
|
|
6931
6951
|
*/
|
|
6932
6952
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
6933
6953
|
/**
|
|
6934
6954
|
* Require non-empty specifier list in import and export statements.
|
|
6935
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6955
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/require-module-specifiers.md
|
|
6936
6956
|
*/
|
|
6937
6957
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
6938
6958
|
/**
|
|
6939
6959
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
6940
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6960
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
6941
6961
|
*/
|
|
6942
6962
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
6943
6963
|
/**
|
|
6944
6964
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
6945
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6965
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/require-post-message-target-origin.md
|
|
6946
6966
|
*/
|
|
6947
6967
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
6948
6968
|
/**
|
|
6949
6969
|
* Enforce better string content.
|
|
6950
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6970
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/string-content.md
|
|
6951
6971
|
*/
|
|
6952
6972
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
6953
6973
|
/**
|
|
6954
6974
|
* Enforce consistent brace style for `case` clauses.
|
|
6955
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6975
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/switch-case-braces.md
|
|
6956
6976
|
*/
|
|
6957
6977
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
6978
|
+
/**
|
|
6979
|
+
* Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.
|
|
6980
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/switch-case-break-position.md
|
|
6981
|
+
*/
|
|
6982
|
+
'unicorn/switch-case-break-position'?: Linter.RuleEntry<[]>;
|
|
6958
6983
|
/**
|
|
6959
6984
|
* Fix whitespace-insensitive template indentation.
|
|
6960
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6985
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/template-indent.md
|
|
6961
6986
|
*/
|
|
6962
6987
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
6963
6988
|
/**
|
|
6964
6989
|
* Enforce consistent case for text encoding identifiers.
|
|
6965
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6990
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/text-encoding-identifier-case.md
|
|
6966
6991
|
*/
|
|
6967
6992
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>;
|
|
6968
6993
|
/**
|
|
6969
6994
|
* Require `new` when creating an error.
|
|
6970
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6995
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v64.0.0/docs/rules/throw-new-error.md
|
|
6971
6996
|
*/
|
|
6972
6997
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
6973
6998
|
/**
|
|
@@ -15032,6 +15057,7 @@ type UnicornEscapeCase = [] | [("uppercase" | "lowercase")]; // ----- unicorn/ex
|
|
|
15032
15057
|
type UnicornExpiringTodoComments = [] | [{
|
|
15033
15058
|
terms?: string[];
|
|
15034
15059
|
ignore?: unknown[];
|
|
15060
|
+
ignoreDates?: boolean;
|
|
15035
15061
|
ignoreDatesOnPullRequests?: boolean;
|
|
15036
15062
|
allowWarningComments?: boolean;
|
|
15037
15063
|
date?: string;
|
|
@@ -15188,6 +15214,9 @@ type _UnicornPreventAbbreviationsReplacements = (false | _UnicornPreventAbbrevia
|
|
|
15188
15214
|
interface _UnicornPreventAbbreviations_Abbreviations {
|
|
15189
15215
|
[k: string]: _UnicornPreventAbbreviationsReplacements | undefined;
|
|
15190
15216
|
}
|
|
15217
|
+
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
15218
|
+
[k: string]: boolean | undefined;
|
|
15219
|
+
}
|
|
15191
15220
|
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
15192
15221
|
[k: string]: boolean | undefined;
|
|
15193
15222
|
} // ----- unicorn/relative-url-style -----
|
package/dist/index.mjs
CHANGED
|
@@ -557,15 +557,15 @@ const defineConfig = async ({ astro = false, autoDetect = true, gitignore = fals
|
|
|
557
557
|
];
|
|
558
558
|
const featureConfigs = await Promise.all([
|
|
559
559
|
isTypescriptEnabled && unwrap(import("./typescript-BDNbtOD5.mjs"), typescript),
|
|
560
|
-
isReactEnabled && unwrap(import("./react-
|
|
561
|
-
isTanstackQueryEnabled && unwrap(import("./tanstack-query-
|
|
560
|
+
isReactEnabled && unwrap(import("./react-CWFVE51B.mjs"), react),
|
|
561
|
+
isTanstackQueryEnabled && unwrap(import("./tanstack-query-ntNKBb-Z.mjs"), tanstackQuery),
|
|
562
562
|
isAstroEnabled && unwrap(import("./astro-B0kgVZlh.mjs"), astro),
|
|
563
563
|
isJestEnabled && unwrap(import("./jest-W70UkOeC.mjs"), jest),
|
|
564
564
|
isVitestEnabled && unwrap(import("./vitest-BXTl-VRj.mjs"), vitest),
|
|
565
565
|
isTestingLibraryEnabled && unwrap(import("./testing-library-B1I63Phd.mjs"), testingLibrary),
|
|
566
566
|
isPlaywrightEnabled && unwrap(import("./playwright-hse_Mk2B.mjs"), playwright),
|
|
567
567
|
isStorybookEnabled && unwrap(import("./storybook-Cmw5qksj.mjs"), storybook),
|
|
568
|
-
isNextjsEnabled && unwrap(import("./nextjs-
|
|
568
|
+
isNextjsEnabled && unwrap(import("./nextjs-Dq5nQ9ib.mjs"), nextjs)
|
|
569
569
|
]);
|
|
570
570
|
return [
|
|
571
571
|
...gitignore ? [gitignoreConfig({ strict: false })] : [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GLOB_NEXTJS } from "./globs.mjs";
|
|
1
|
+
import { GLOB_NEXTJS, GLOB_NEXTJS_ENV } from "./globs.mjs";
|
|
2
2
|
import { n as extractOptions, t as unwrapDefault } from "./interop-default-BDN5nH8B.mjs";
|
|
3
3
|
import { t as upwarn } from "./upwarn-Bq0SLcj_.mjs";
|
|
4
4
|
//#region src/rules/nextjs.ts
|
|
@@ -18,6 +18,9 @@ async function nextjsConfig(options) {
|
|
|
18
18
|
name: "jimmy.codes/nextjs",
|
|
19
19
|
plugins: { "@next/next": nextjsPlugin },
|
|
20
20
|
rules: await nextjsRules(extractedOptions)
|
|
21
|
+
}, {
|
|
22
|
+
files: GLOB_NEXTJS_ENV,
|
|
23
|
+
rules: { "import-x/extensions": "off" }
|
|
21
24
|
}];
|
|
22
25
|
}
|
|
23
26
|
//#endregion
|
|
@@ -5,6 +5,7 @@ import { t as upwarn } from "./upwarn-Bq0SLcj_.mjs";
|
|
|
5
5
|
import globals from "globals";
|
|
6
6
|
//#region src/rules/react.ts
|
|
7
7
|
const nextAllowedExportNames = [
|
|
8
|
+
"experimental_ppr",
|
|
8
9
|
"dynamic",
|
|
9
10
|
"dynamicParams",
|
|
10
11
|
"revalidate",
|
|
@@ -12,12 +13,16 @@ const nextAllowedExportNames = [
|
|
|
12
13
|
"runtime",
|
|
13
14
|
"preferredRegion",
|
|
14
15
|
"maxDuration",
|
|
15
|
-
"config",
|
|
16
|
-
"generateStaticParams",
|
|
17
16
|
"metadata",
|
|
18
17
|
"generateMetadata",
|
|
19
18
|
"viewport",
|
|
20
|
-
"generateViewport"
|
|
19
|
+
"generateViewport",
|
|
20
|
+
"generateImageMetadata",
|
|
21
|
+
"generateSitemaps",
|
|
22
|
+
"generateStaticParams",
|
|
23
|
+
"alt",
|
|
24
|
+
"size",
|
|
25
|
+
"contentType"
|
|
21
26
|
];
|
|
22
27
|
const reactRules = async (options) => {
|
|
23
28
|
const [{ configs: reactConfigs }, { flatConfigs: jsxA11yConfigs }, { configs: reactDomConfigs }, { configs: reactHooksExtraConfigs }, { configs: reactWebApiConfigs }, { configs: reactNamingConventionConfigs }, { configs: reactRscConfigs }] = await Promise.all([
|
|
@@ -15,6 +15,7 @@ async function tanstackQueryConfig(options) {
|
|
|
15
15
|
"@tanstack/query/no-rest-destructuring": "error",
|
|
16
16
|
"@tanstack/query/no-unstable-deps": "error",
|
|
17
17
|
"@tanstack/query/no-void-query-fn": "error",
|
|
18
|
+
"@tanstack/query/prefer-query-options": "error",
|
|
18
19
|
"@tanstack/query/stable-query-client": "error",
|
|
19
20
|
...extractedOptions?.overrides
|
|
20
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jimmy.codes/eslint-config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.1",
|
|
4
4
|
"description": "A simple, modern ESLint config that covers most use cases.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
43
43
|
"@eslint/js": "^9.39.4",
|
|
44
|
-
"@next/eslint-plugin-next": "^16.2.
|
|
44
|
+
"@next/eslint-plugin-next": "^16.2.2",
|
|
45
45
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
46
|
-
"@tanstack/eslint-plugin-query": "^5.
|
|
46
|
+
"@tanstack/eslint-plugin-query": "^5.96.1",
|
|
47
47
|
"@types/eslint": "9.6.1",
|
|
48
|
-
"@typescript-eslint/parser": "^8.
|
|
49
|
-
"@typescript-eslint/utils": "^8.
|
|
50
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
48
|
+
"@typescript-eslint/parser": "^8.58.0",
|
|
49
|
+
"@typescript-eslint/utils": "^8.58.0",
|
|
50
|
+
"@vitest/eslint-plugin": "^1.6.14",
|
|
51
51
|
"astro-eslint-parser": "^1.4.0",
|
|
52
52
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
53
53
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"eslint-plugin-import-x": "^4.16.2",
|
|
60
60
|
"eslint-plugin-jest": "^29.15.1",
|
|
61
61
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
62
|
-
"eslint-plugin-jsdoc": "^62.
|
|
62
|
+
"eslint-plugin-jsdoc": "^62.9.0",
|
|
63
63
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
64
64
|
"eslint-plugin-n": "^17.24.0",
|
|
65
65
|
"eslint-plugin-perfectionist": "^5.7.0",
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"eslint-plugin-regexp": "^3.1.0",
|
|
77
77
|
"eslint-plugin-storybook": "0.12.0",
|
|
78
78
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
79
|
-
"eslint-plugin-unicorn": "^
|
|
79
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
80
80
|
"globals": "^17.4.0",
|
|
81
81
|
"local-pkg": "^1.1.2",
|
|
82
|
-
"typescript-eslint": "^8.
|
|
82
|
+
"typescript-eslint": "^8.58.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"eslint": ">=9.38.0"
|