From fe527a604b020fd1b5c9837ec1bfc273f1316718 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 7 May 2024 13:19:38 +0800 Subject: [PATCH] Linting (#2328) --- .eslint-doc-generatorrc.js | 2 +- docs/rules/better-regex.md | 2 +- docs/rules/catch-error-name.md | 2 +- docs/rules/consistent-destructuring.md | 2 +- docs/rules/consistent-function-scoping.md | 2 +- docs/rules/custom-error-definition.md | 2 +- docs/rules/empty-brace-spaces.md | 2 +- docs/rules/error-message.md | 2 +- docs/rules/escape-case.md | 2 +- docs/rules/expiring-todo-comments.md | 2 +- docs/rules/explicit-length-check.md | 2 +- docs/rules/filename-case.md | 2 +- docs/rules/import-style.md | 2 +- docs/rules/new-for-builtins.md | 2 +- docs/rules/no-abusive-eslint-disable.md | 2 +- docs/rules/no-anonymous-default-export.md | 2 +- docs/rules/no-array-callback-reference.md | 2 +- docs/rules/no-array-for-each.md | 2 +- docs/rules/no-array-method-this-argument.md | 2 +- docs/rules/no-array-push-push.md | 2 +- docs/rules/no-array-reduce.md | 2 +- docs/rules/no-await-expression-member.md | 2 +- docs/rules/no-await-in-promise-methods.md | 2 +- docs/rules/no-console-spaces.md | 2 +- docs/rules/no-document-cookie.md | 2 +- docs/rules/no-empty-file.md | 2 +- docs/rules/no-for-loop.md | 2 +- docs/rules/no-hex-escape.md | 2 +- docs/rules/no-instanceof-array.md | 2 +- .../rules/no-invalid-remove-event-listener.md | 2 +- docs/rules/no-keyword-prefix.md | 2 +- docs/rules/no-lonely-if.md | 2 +- docs/rules/no-negated-condition.md | 2 +- docs/rules/no-nested-ternary.md | 2 +- docs/rules/no-new-array.md | 2 +- docs/rules/no-new-buffer.md | 2 +- docs/rules/no-null.md | 2 +- docs/rules/no-object-as-default-parameter.md | 2 +- docs/rules/no-process-exit.md | 2 +- .../no-single-promise-in-promise-methods.md | 2 +- docs/rules/no-static-only-class.md | 2 +- docs/rules/no-thenable.md | 2 +- docs/rules/no-this-assignment.md | 2 +- docs/rules/no-typeof-undefined.md | 2 +- docs/rules/no-unnecessary-await.md | 2 +- docs/rules/no-unnecessary-polyfills.md | 2 +- .../no-unreadable-array-destructuring.md | 2 +- docs/rules/no-unreadable-iife.md | 2 +- docs/rules/no-unused-properties.md | 2 +- docs/rules/no-useless-fallback-in-spread.md | 2 +- docs/rules/no-useless-length-check.md | 2 +- .../no-useless-promise-resolve-reject.md | 2 +- docs/rules/no-useless-spread.md | 2 +- docs/rules/no-useless-switch-case.md | 2 +- docs/rules/no-useless-undefined.md | 2 +- docs/rules/no-zero-fractions.md | 2 +- docs/rules/number-literal-case.md | 2 +- docs/rules/numeric-separators-style.md | 2 +- docs/rules/prefer-add-event-listener.md | 2 +- docs/rules/prefer-array-find.md | 2 +- docs/rules/prefer-array-flat-map.md | 2 +- docs/rules/prefer-array-flat.md | 2 +- docs/rules/prefer-array-index-of.md | 2 +- docs/rules/prefer-array-some.md | 2 +- docs/rules/prefer-at.md | 2 +- docs/rules/prefer-blob-reading-methods.md | 2 +- docs/rules/prefer-code-point.md | 2 +- docs/rules/prefer-date-now.md | 2 +- docs/rules/prefer-default-parameters.md | 2 +- docs/rules/prefer-dom-node-append.md | 2 +- docs/rules/prefer-dom-node-dataset.md | 2 +- docs/rules/prefer-dom-node-remove.md | 2 +- docs/rules/prefer-dom-node-text-content.md | 2 +- docs/rules/prefer-event-target.md | 2 +- docs/rules/prefer-export-from.md | 2 +- docs/rules/prefer-includes.md | 2 +- docs/rules/prefer-json-parse-buffer.md | 2 +- docs/rules/prefer-keyboard-event-key.md | 2 +- .../prefer-logical-operator-over-ternary.md | 2 +- docs/rules/prefer-math-trunc.md | 2 +- docs/rules/prefer-modern-dom-apis.md | 2 +- docs/rules/prefer-modern-math-apis.md | 2 +- docs/rules/prefer-module.md | 2 +- .../rules/prefer-native-coercion-functions.md | 2 +- docs/rules/prefer-negative-index.md | 2 +- docs/rules/prefer-node-protocol.md | 2 +- docs/rules/prefer-number-properties.md | 2 +- docs/rules/prefer-object-from-entries.md | 2 +- docs/rules/prefer-optional-catch-binding.md | 2 +- docs/rules/prefer-prototype-methods.md | 2 +- docs/rules/prefer-query-selector.md | 2 +- docs/rules/prefer-reflect-apply.md | 2 +- docs/rules/prefer-regexp-test.md | 2 +- docs/rules/prefer-set-has.md | 2 +- docs/rules/prefer-set-size.md | 2 +- docs/rules/prefer-spread.md | 2 +- docs/rules/prefer-string-replace-all.md | 2 +- docs/rules/prefer-string-slice.md | 2 +- docs/rules/prefer-string-starts-ends-with.md | 2 +- docs/rules/prefer-string-trim-start-end.md | 2 +- docs/rules/prefer-switch.md | 2 +- docs/rules/prefer-ternary.md | 2 +- docs/rules/prefer-top-level-await.md | 2 +- docs/rules/prefer-type-error.md | 2 +- docs/rules/prevent-abbreviations.md | 2 +- docs/rules/relative-url-style.md | 2 +- docs/rules/require-array-join-separator.md | 2 +- ...require-number-to-fixed-digits-argument.md | 2 +- .../require-post-message-target-origin.md | 2 +- docs/rules/string-content.md | 2 +- docs/rules/switch-case-braces.md | 2 +- docs/rules/template-indent.md | 2 +- docs/rules/text-encoding-identifier-case.md | 2 +- docs/rules/throw-new-error.md | 2 +- readme.md | 2 +- rules/expiring-todo-comments.js | 12 +++- rules/explicit-length-check.js | 7 ++- rules/no-array-for-each.js | 14 ++++- rules/no-useless-promise-resolve-reject.js | 4 +- rules/prefer-add-event-listener.js | 2 +- rules/prefer-export-from.js | 4 +- rules/prefer-string-slice.js | 7 ++- rules/string-content.js | 3 +- rules/utils/numeric.js | 7 ++- rules/utils/rule.js | 8 +-- test/consistent-function-scoping.mjs | 63 ++++++++++++++++--- test/utils/parsers.mjs | 6 +- test/utils/test.mjs | 2 +- 128 files changed, 223 insertions(+), 146 deletions(-) diff --git a/.eslint-doc-generatorrc.js b/.eslint-doc-generatorrc.js index 0f1f832fab..f4a896b273 100644 --- a/.eslint-doc-generatorrc.js +++ b/.eslint-doc-generatorrc.js @@ -15,7 +15,7 @@ const config = { 'hasSuggestions', 'requiresTypeChecking', ], - urlConfigs: 'https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs', + urlConfigs: 'https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs', }; module.exports = config; diff --git a/docs/rules/better-regex.md b/docs/rules/better-regex.md index f64c3b0fe4..c2baeb27fa 100644 --- a/docs/rules/better-regex.md +++ b/docs/rules/better-regex.md @@ -1,6 +1,6 @@ # Improve regexes by making them shorter, consistent, and safer -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/catch-error-name.md b/docs/rules/catch-error-name.md index 9348f21f3f..5fe97e3143 100644 --- a/docs/rules/catch-error-name.md +++ b/docs/rules/catch-error-name.md @@ -1,6 +1,6 @@ # Enforce a specific parameter name in catch clauses -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/consistent-destructuring.md b/docs/rules/consistent-destructuring.md index bdc6cd708e..1a4ef0d51b 100644 --- a/docs/rules/consistent-destructuring.md +++ b/docs/rules/consistent-destructuring.md @@ -1,6 +1,6 @@ # Use destructured variables over properties -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/consistent-function-scoping.md b/docs/rules/consistent-function-scoping.md index f03ddc35b9..2f4d122493 100644 --- a/docs/rules/consistent-function-scoping.md +++ b/docs/rules/consistent-function-scoping.md @@ -1,6 +1,6 @@ # Move function definitions to the highest possible scope -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/custom-error-definition.md b/docs/rules/custom-error-definition.md index 62590cc229..73b6d5e960 100644 --- a/docs/rules/custom-error-definition.md +++ b/docs/rules/custom-error-definition.md @@ -1,6 +1,6 @@ # Enforce correct `Error` subclassing -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/empty-brace-spaces.md b/docs/rules/empty-brace-spaces.md index e6df45dac5..f0b275cf91 100644 --- a/docs/rules/empty-brace-spaces.md +++ b/docs/rules/empty-brace-spaces.md @@ -1,6 +1,6 @@ # Enforce no spaces between braces -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/error-message.md b/docs/rules/error-message.md index c1bfca442d..0a195c33a5 100644 --- a/docs/rules/error-message.md +++ b/docs/rules/error-message.md @@ -1,6 +1,6 @@ # Enforce passing a `message` value when creating a built-in error -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/escape-case.md b/docs/rules/escape-case.md index e302e66af7..18b9782ebe 100644 --- a/docs/rules/escape-case.md +++ b/docs/rules/escape-case.md @@ -1,6 +1,6 @@ # Require escape sequences to use uppercase values -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/expiring-todo-comments.md b/docs/rules/expiring-todo-comments.md index f4bc55e614..5135bc5b5f 100644 --- a/docs/rules/expiring-todo-comments.md +++ b/docs/rules/expiring-todo-comments.md @@ -1,6 +1,6 @@ # Add expiration conditions to TODO comments -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/explicit-length-check.md b/docs/rules/explicit-length-check.md index decb245355..58d0a804c0 100644 --- a/docs/rules/explicit-length-check.md +++ b/docs/rules/explicit-length-check.md @@ -1,6 +1,6 @@ # Enforce explicitly comparing the `length` or `size` property of a value -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/filename-case.md b/docs/rules/filename-case.md index c4f19c3267..197167b892 100644 --- a/docs/rules/filename-case.md +++ b/docs/rules/filename-case.md @@ -1,6 +1,6 @@ # Enforce a case style for filenames -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/import-style.md b/docs/rules/import-style.md index d60d310ef4..805725f088 100644 --- a/docs/rules/import-style.md +++ b/docs/rules/import-style.md @@ -1,6 +1,6 @@ # Enforce specific import styles per module -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/new-for-builtins.md b/docs/rules/new-for-builtins.md index 871e87d8fe..ad1453c774 100644 --- a/docs/rules/new-for-builtins.md +++ b/docs/rules/new-for-builtins.md @@ -1,6 +1,6 @@ # Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-abusive-eslint-disable.md b/docs/rules/no-abusive-eslint-disable.md index ce0b800a98..ea0eb3a89c 100644 --- a/docs/rules/no-abusive-eslint-disable.md +++ b/docs/rules/no-abusive-eslint-disable.md @@ -1,6 +1,6 @@ # Enforce specifying rules to disable in `eslint-disable` comments -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-anonymous-default-export.md b/docs/rules/no-anonymous-default-export.md index 8525b946c5..e8675c0c6a 100644 --- a/docs/rules/no-anonymous-default-export.md +++ b/docs/rules/no-anonymous-default-export.md @@ -1,6 +1,6 @@ # Disallow anonymous functions and classes as the default export -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-array-callback-reference.md b/docs/rules/no-array-callback-reference.md index 035c698225..e1cb6f386f 100644 --- a/docs/rules/no-array-callback-reference.md +++ b/docs/rules/no-array-callback-reference.md @@ -1,6 +1,6 @@ # Prevent passing a function reference directly to iterator methods -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-array-for-each.md b/docs/rules/no-array-for-each.md index e6b01f10a8..015440cca0 100644 --- a/docs/rules/no-array-for-each.md +++ b/docs/rules/no-array-for-each.md @@ -1,6 +1,6 @@ # Prefer `for…of` over the `forEach` method -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-array-method-this-argument.md b/docs/rules/no-array-method-this-argument.md index 8dea99564a..f16fa56a12 100644 --- a/docs/rules/no-array-method-this-argument.md +++ b/docs/rules/no-array-method-this-argument.md @@ -1,6 +1,6 @@ # Disallow using the `this` argument in array methods -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-array-push-push.md b/docs/rules/no-array-push-push.md index 914fe9f87e..09a65cbf1a 100644 --- a/docs/rules/no-array-push-push.md +++ b/docs/rules/no-array-push-push.md @@ -1,6 +1,6 @@ # Enforce combining multiple `Array#push()` into one call -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-array-reduce.md b/docs/rules/no-array-reduce.md index fc8af7ea1f..858f6b838a 100644 --- a/docs/rules/no-array-reduce.md +++ b/docs/rules/no-array-reduce.md @@ -1,6 +1,6 @@ # Disallow `Array#reduce()` and `Array#reduceRight()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-await-expression-member.md b/docs/rules/no-await-expression-member.md index 3bd13b5109..632655faf0 100644 --- a/docs/rules/no-await-expression-member.md +++ b/docs/rules/no-await-expression-member.md @@ -1,6 +1,6 @@ # Disallow member access from await expression -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-await-in-promise-methods.md b/docs/rules/no-await-in-promise-methods.md index e42e16d55d..3f440bdac3 100644 --- a/docs/rules/no-await-in-promise-methods.md +++ b/docs/rules/no-await-in-promise-methods.md @@ -1,6 +1,6 @@ # Disallow using `await` in `Promise` method parameters -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-console-spaces.md b/docs/rules/no-console-spaces.md index d205924a90..56b913386d 100644 --- a/docs/rules/no-console-spaces.md +++ b/docs/rules/no-console-spaces.md @@ -1,6 +1,6 @@ # Do not use leading/trailing space between `console.log` parameters -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-document-cookie.md b/docs/rules/no-document-cookie.md index a49eb60a4f..3dc54a1eba 100644 --- a/docs/rules/no-document-cookie.md +++ b/docs/rules/no-document-cookie.md @@ -1,6 +1,6 @@ # Do not use `document.cookie` directly -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-empty-file.md b/docs/rules/no-empty-file.md index 72244e26d4..16fa4ac302 100644 --- a/docs/rules/no-empty-file.md +++ b/docs/rules/no-empty-file.md @@ -1,6 +1,6 @@ # Disallow empty files -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-for-loop.md b/docs/rules/no-for-loop.md index 4b6d3d5cac..5affa0208c 100644 --- a/docs/rules/no-for-loop.md +++ b/docs/rules/no-for-loop.md @@ -1,6 +1,6 @@ # Do not use a `for` loop that can be replaced with a `for-of` loop -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-hex-escape.md b/docs/rules/no-hex-escape.md index af5c3052c4..ac90330966 100644 --- a/docs/rules/no-hex-escape.md +++ b/docs/rules/no-hex-escape.md @@ -1,6 +1,6 @@ # Enforce the use of Unicode escapes instead of hexadecimal escapes -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-instanceof-array.md b/docs/rules/no-instanceof-array.md index 28078b1398..05bf59dc8d 100644 --- a/docs/rules/no-instanceof-array.md +++ b/docs/rules/no-instanceof-array.md @@ -1,6 +1,6 @@ # Require `Array.isArray()` instead of `instanceof Array` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-invalid-remove-event-listener.md b/docs/rules/no-invalid-remove-event-listener.md index ca4fe78585..06f3a743e4 100644 --- a/docs/rules/no-invalid-remove-event-listener.md +++ b/docs/rules/no-invalid-remove-event-listener.md @@ -1,6 +1,6 @@ # Prevent calling `EventTarget#removeEventListener()` with the result of an expression -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-keyword-prefix.md b/docs/rules/no-keyword-prefix.md index 7398732bbc..18671a5c44 100644 --- a/docs/rules/no-keyword-prefix.md +++ b/docs/rules/no-keyword-prefix.md @@ -1,6 +1,6 @@ # Disallow identifiers starting with `new` or `class` -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-lonely-if.md b/docs/rules/no-lonely-if.md index 02f62640f4..3c0cf5e894 100644 --- a/docs/rules/no-lonely-if.md +++ b/docs/rules/no-lonely-if.md @@ -1,6 +1,6 @@ # Disallow `if` statements as the only statement in `if` blocks without `else` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-negated-condition.md b/docs/rules/no-negated-condition.md index 496d6a5644..3c1624218f 100644 --- a/docs/rules/no-negated-condition.md +++ b/docs/rules/no-negated-condition.md @@ -1,6 +1,6 @@ # Disallow negated conditions -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-nested-ternary.md b/docs/rules/no-nested-ternary.md index d937c7c3d2..b4ecf32363 100644 --- a/docs/rules/no-nested-ternary.md +++ b/docs/rules/no-nested-ternary.md @@ -1,6 +1,6 @@ # Disallow nested ternary expressions -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-new-array.md b/docs/rules/no-new-array.md index 574513309c..c75f3e4c5b 100644 --- a/docs/rules/no-new-array.md +++ b/docs/rules/no-new-array.md @@ -1,6 +1,6 @@ # Disallow `new Array()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-new-buffer.md b/docs/rules/no-new-buffer.md index 982b7338ae..e83f7bf954 100644 --- a/docs/rules/no-new-buffer.md +++ b/docs/rules/no-new-buffer.md @@ -1,6 +1,6 @@ # Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-null.md b/docs/rules/no-null.md index 15f5417894..f739e14c8c 100644 --- a/docs/rules/no-null.md +++ b/docs/rules/no-null.md @@ -1,6 +1,6 @@ # Disallow the use of the `null` literal -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-object-as-default-parameter.md b/docs/rules/no-object-as-default-parameter.md index f052643b5d..1089080520 100644 --- a/docs/rules/no-object-as-default-parameter.md +++ b/docs/rules/no-object-as-default-parameter.md @@ -1,6 +1,6 @@ # Disallow the use of objects as default parameters -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-process-exit.md b/docs/rules/no-process-exit.md index 60e6a14598..9f47af80e1 100644 --- a/docs/rules/no-process-exit.md +++ b/docs/rules/no-process-exit.md @@ -1,6 +1,6 @@ # Disallow `process.exit()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-single-promise-in-promise-methods.md b/docs/rules/no-single-promise-in-promise-methods.md index 50cb47e4f5..1cc12515f0 100644 --- a/docs/rules/no-single-promise-in-promise-methods.md +++ b/docs/rules/no-single-promise-in-promise-methods.md @@ -1,6 +1,6 @@ # Disallow passing single-element arrays to `Promise` methods -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-static-only-class.md b/docs/rules/no-static-only-class.md index d06ad9b41c..9efb5eb9b0 100644 --- a/docs/rules/no-static-only-class.md +++ b/docs/rules/no-static-only-class.md @@ -1,6 +1,6 @@ # Disallow classes that only have static members -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-thenable.md b/docs/rules/no-thenable.md index 93bfb58d8a..bbb2ec84f7 100644 --- a/docs/rules/no-thenable.md +++ b/docs/rules/no-thenable.md @@ -1,6 +1,6 @@ # Disallow `then` property -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-this-assignment.md b/docs/rules/no-this-assignment.md index 26c7bee6d7..3390eaa3ac 100644 --- a/docs/rules/no-this-assignment.md +++ b/docs/rules/no-this-assignment.md @@ -1,6 +1,6 @@ # Disallow assigning `this` to a variable -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-typeof-undefined.md b/docs/rules/no-typeof-undefined.md index f48a5f84c9..b30c2699a6 100644 --- a/docs/rules/no-typeof-undefined.md +++ b/docs/rules/no-typeof-undefined.md @@ -1,6 +1,6 @@ # Disallow comparing `undefined` using `typeof` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-unnecessary-await.md b/docs/rules/no-unnecessary-await.md index e60a98e73e..5417b30161 100644 --- a/docs/rules/no-unnecessary-await.md +++ b/docs/rules/no-unnecessary-await.md @@ -1,6 +1,6 @@ # Disallow awaiting non-promise values -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-unnecessary-polyfills.md b/docs/rules/no-unnecessary-polyfills.md index c888e32a43..5c8483a6e3 100644 --- a/docs/rules/no-unnecessary-polyfills.md +++ b/docs/rules/no-unnecessary-polyfills.md @@ -1,6 +1,6 @@ # Enforce the use of built-in methods instead of unnecessary polyfills -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-unreadable-array-destructuring.md b/docs/rules/no-unreadable-array-destructuring.md index 70ab510e23..a8046117e5 100644 --- a/docs/rules/no-unreadable-array-destructuring.md +++ b/docs/rules/no-unreadable-array-destructuring.md @@ -1,6 +1,6 @@ # Disallow unreadable array destructuring -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-unreadable-iife.md b/docs/rules/no-unreadable-iife.md index 4124c06bd6..9c2eae6620 100644 --- a/docs/rules/no-unreadable-iife.md +++ b/docs/rules/no-unreadable-iife.md @@ -1,6 +1,6 @@ # Disallow unreadable IIFEs -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-unused-properties.md b/docs/rules/no-unused-properties.md index e9dc8835b3..d77cafc2cf 100644 --- a/docs/rules/no-unused-properties.md +++ b/docs/rules/no-unused-properties.md @@ -1,6 +1,6 @@ # Disallow unused object properties -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/no-useless-fallback-in-spread.md b/docs/rules/no-useless-fallback-in-spread.md index 56a17a0509..ce14f2edfc 100644 --- a/docs/rules/no-useless-fallback-in-spread.md +++ b/docs/rules/no-useless-fallback-in-spread.md @@ -1,6 +1,6 @@ # Disallow useless fallback when spreading in object literals -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-useless-length-check.md b/docs/rules/no-useless-length-check.md index 8b3ace84ab..3fea70973b 100644 --- a/docs/rules/no-useless-length-check.md +++ b/docs/rules/no-useless-length-check.md @@ -1,6 +1,6 @@ # Disallow useless array length check -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-useless-promise-resolve-reject.md b/docs/rules/no-useless-promise-resolve-reject.md index 92e039716e..4d0857c17e 100644 --- a/docs/rules/no-useless-promise-resolve-reject.md +++ b/docs/rules/no-useless-promise-resolve-reject.md @@ -1,6 +1,6 @@ # Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-useless-spread.md b/docs/rules/no-useless-spread.md index 86465f93a6..8626732b7e 100644 --- a/docs/rules/no-useless-spread.md +++ b/docs/rules/no-useless-spread.md @@ -1,6 +1,6 @@ # Disallow unnecessary spread -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-useless-switch-case.md b/docs/rules/no-useless-switch-case.md index a4fe0952e9..eb7a1faf35 100644 --- a/docs/rules/no-useless-switch-case.md +++ b/docs/rules/no-useless-switch-case.md @@ -1,6 +1,6 @@ # Disallow useless case in switch statements -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-useless-undefined.md b/docs/rules/no-useless-undefined.md index 9ea6680af8..af4b50fdd1 100644 --- a/docs/rules/no-useless-undefined.md +++ b/docs/rules/no-useless-undefined.md @@ -1,6 +1,6 @@ # Disallow useless `undefined` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-zero-fractions.md b/docs/rules/no-zero-fractions.md index 3d3e4deb36..22495ca480 100644 --- a/docs/rules/no-zero-fractions.md +++ b/docs/rules/no-zero-fractions.md @@ -1,6 +1,6 @@ # Disallow number literals with zero fractions or dangling dots -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/number-literal-case.md b/docs/rules/number-literal-case.md index 4a9a22ef9b..dbb092416e 100644 --- a/docs/rules/number-literal-case.md +++ b/docs/rules/number-literal-case.md @@ -1,6 +1,6 @@ # Enforce proper case for numeric literals -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/numeric-separators-style.md b/docs/rules/numeric-separators-style.md index 12353606fa..4af101fad4 100644 --- a/docs/rules/numeric-separators-style.md +++ b/docs/rules/numeric-separators-style.md @@ -1,6 +1,6 @@ # Enforce the style of numeric separators by correctly grouping digits -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-add-event-listener.md b/docs/rules/prefer-add-event-listener.md index 338cad2a2a..1e2c8ad2f0 100644 --- a/docs/rules/prefer-add-event-listener.md +++ b/docs/rules/prefer-add-event-listener.md @@ -1,6 +1,6 @@ # Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-array-find.md b/docs/rules/prefer-array-find.md index a36c362958..5b7065e03c 100644 --- a/docs/rules/prefer-array-find.md +++ b/docs/rules/prefer-array-find.md @@ -1,6 +1,6 @@ # Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-array-flat-map.md b/docs/rules/prefer-array-flat-map.md index 0b67390730..512d2070c2 100644 --- a/docs/rules/prefer-array-flat-map.md +++ b/docs/rules/prefer-array-flat-map.md @@ -1,6 +1,6 @@ # Prefer `.flatMap(…)` over `.map(…).flat()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-array-flat.md b/docs/rules/prefer-array-flat.md index e8795440fb..721596d784 100644 --- a/docs/rules/prefer-array-flat.md +++ b/docs/rules/prefer-array-flat.md @@ -1,6 +1,6 @@ # Prefer `Array#flat()` over legacy techniques to flatten arrays -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-array-index-of.md b/docs/rules/prefer-array-index-of.md index 59292b0e30..421615a072 100644 --- a/docs/rules/prefer-array-index-of.md +++ b/docs/rules/prefer-array-index-of.md @@ -1,6 +1,6 @@ # Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-array-some.md b/docs/rules/prefer-array-some.md index a579540eb6..cc11083488 100644 --- a/docs/rules/prefer-array-some.md +++ b/docs/rules/prefer-array-some.md @@ -1,6 +1,6 @@ # Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast}(…)` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-at.md b/docs/rules/prefer-at.md index 1720004a83..50079b3777 100644 --- a/docs/rules/prefer-at.md +++ b/docs/rules/prefer-at.md @@ -1,6 +1,6 @@ # Prefer `.at()` method for index access and `String#charAt()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-blob-reading-methods.md b/docs/rules/prefer-blob-reading-methods.md index f2e2e57145..d6b0d8c3fe 100644 --- a/docs/rules/prefer-blob-reading-methods.md +++ b/docs/rules/prefer-blob-reading-methods.md @@ -1,6 +1,6 @@ # Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/prefer-code-point.md b/docs/rules/prefer-code-point.md index 3ca2de6686..a98b06521d 100644 --- a/docs/rules/prefer-code-point.md +++ b/docs/rules/prefer-code-point.md @@ -1,6 +1,6 @@ # Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-date-now.md b/docs/rules/prefer-date-now.md index df232abc0d..ee50fa7ee9 100644 --- a/docs/rules/prefer-date-now.md +++ b/docs/rules/prefer-date-now.md @@ -1,6 +1,6 @@ # Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-default-parameters.md b/docs/rules/prefer-default-parameters.md index e88d7a483f..699e4ea73c 100644 --- a/docs/rules/prefer-default-parameters.md +++ b/docs/rules/prefer-default-parameters.md @@ -1,6 +1,6 @@ # Prefer default parameters over reassignment -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-dom-node-append.md b/docs/rules/prefer-dom-node-append.md index 9ef1a87c7b..9c108537b1 100644 --- a/docs/rules/prefer-dom-node-append.md +++ b/docs/rules/prefer-dom-node-append.md @@ -1,6 +1,6 @@ # Prefer `Node#append()` over `Node#appendChild()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-dom-node-dataset.md b/docs/rules/prefer-dom-node-dataset.md index 5cdcd31919..5901f42834 100644 --- a/docs/rules/prefer-dom-node-dataset.md +++ b/docs/rules/prefer-dom-node-dataset.md @@ -1,6 +1,6 @@ # Prefer using `.dataset` on DOM elements over calling attribute methods -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-dom-node-remove.md b/docs/rules/prefer-dom-node-remove.md index e0373dd47a..1d54903125 100644 --- a/docs/rules/prefer-dom-node-remove.md +++ b/docs/rules/prefer-dom-node-remove.md @@ -1,6 +1,6 @@ # Prefer `childNode.remove()` over `parentNode.removeChild(childNode)` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-dom-node-text-content.md b/docs/rules/prefer-dom-node-text-content.md index 97755e187b..94867e0ffc 100644 --- a/docs/rules/prefer-dom-node-text-content.md +++ b/docs/rules/prefer-dom-node-text-content.md @@ -1,6 +1,6 @@ # Prefer `.textContent` over `.innerText` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-event-target.md b/docs/rules/prefer-event-target.md index 4ae87c9672..723ee61aa8 100644 --- a/docs/rules/prefer-event-target.md +++ b/docs/rules/prefer-event-target.md @@ -1,6 +1,6 @@ # Prefer `EventTarget` over `EventEmitter` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). diff --git a/docs/rules/prefer-export-from.md b/docs/rules/prefer-export-from.md index affbc9e9de..64c2de5c6a 100644 --- a/docs/rules/prefer-export-from.md +++ b/docs/rules/prefer-export-from.md @@ -1,6 +1,6 @@ # Prefer `export…from` when re-exporting -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-includes.md b/docs/rules/prefer-includes.md index 28a0b8eb9c..f23d27aec3 100644 --- a/docs/rules/prefer-includes.md +++ b/docs/rules/prefer-includes.md @@ -1,6 +1,6 @@ # Prefer `.includes()` over `.indexOf()` and `Array#some()` when checking for existence or non-existence -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-json-parse-buffer.md b/docs/rules/prefer-json-parse-buffer.md index b25d4fbd13..6478f8bc63 100644 --- a/docs/rules/prefer-json-parse-buffer.md +++ b/docs/rules/prefer-json-parse-buffer.md @@ -1,6 +1,6 @@ # Prefer reading a JSON file as a buffer -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-keyboard-event-key.md b/docs/rules/prefer-keyboard-event-key.md index 0734033241..3d39b69911 100644 --- a/docs/rules/prefer-keyboard-event-key.md +++ b/docs/rules/prefer-keyboard-event-key.md @@ -1,6 +1,6 @@ # Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-logical-operator-over-ternary.md b/docs/rules/prefer-logical-operator-over-ternary.md index 4658bc5d75..075a4f0db2 100644 --- a/docs/rules/prefer-logical-operator-over-ternary.md +++ b/docs/rules/prefer-logical-operator-over-ternary.md @@ -1,6 +1,6 @@ # Prefer using a logical operator over a ternary -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-math-trunc.md b/docs/rules/prefer-math-trunc.md index ca2b711a0d..228380cace 100644 --- a/docs/rules/prefer-math-trunc.md +++ b/docs/rules/prefer-math-trunc.md @@ -1,6 +1,6 @@ # Enforce the use of `Math.trunc` instead of bitwise operators -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-modern-dom-apis.md b/docs/rules/prefer-modern-dom-apis.md index c48c7e19f1..805edbd6e2 100644 --- a/docs/rules/prefer-modern-dom-apis.md +++ b/docs/rules/prefer-modern-dom-apis.md @@ -1,6 +1,6 @@ # Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-modern-math-apis.md b/docs/rules/prefer-modern-math-apis.md index c25a7e0bd2..8360f9d976 100644 --- a/docs/rules/prefer-modern-math-apis.md +++ b/docs/rules/prefer-modern-math-apis.md @@ -1,6 +1,6 @@ # Prefer modern `Math` APIs over legacy patterns -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-module.md b/docs/rules/prefer-module.md index b08fb6ba36..25445a94c8 100644 --- a/docs/rules/prefer-module.md +++ b/docs/rules/prefer-module.md @@ -1,6 +1,6 @@ # Prefer JavaScript modules (ESM) over CommonJS -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-native-coercion-functions.md b/docs/rules/prefer-native-coercion-functions.md index d1de6fd48c..c24922616c 100644 --- a/docs/rules/prefer-native-coercion-functions.md +++ b/docs/rules/prefer-native-coercion-functions.md @@ -1,6 +1,6 @@ # Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-negative-index.md b/docs/rules/prefer-negative-index.md index 89c4e33dd0..371cefc1c0 100644 --- a/docs/rules/prefer-negative-index.md +++ b/docs/rules/prefer-negative-index.md @@ -1,6 +1,6 @@ # Prefer negative index over `.length - index` when possible -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-node-protocol.md b/docs/rules/prefer-node-protocol.md index bb5350cad1..4a962ff7fb 100644 --- a/docs/rules/prefer-node-protocol.md +++ b/docs/rules/prefer-node-protocol.md @@ -1,6 +1,6 @@ # Prefer using the `node:` protocol when importing Node.js builtin modules -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-number-properties.md b/docs/rules/prefer-number-properties.md index 603a8e5fd6..15581b5f24 100644 --- a/docs/rules/prefer-number-properties.md +++ b/docs/rules/prefer-number-properties.md @@ -1,6 +1,6 @@ # Prefer `Number` static properties over global ones -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-object-from-entries.md b/docs/rules/prefer-object-from-entries.md index 293591e599..78e5cf177e 100644 --- a/docs/rules/prefer-object-from-entries.md +++ b/docs/rules/prefer-object-from-entries.md @@ -1,6 +1,6 @@ # Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-optional-catch-binding.md b/docs/rules/prefer-optional-catch-binding.md index 19415bb8f3..6c911c6b0c 100644 --- a/docs/rules/prefer-optional-catch-binding.md +++ b/docs/rules/prefer-optional-catch-binding.md @@ -1,6 +1,6 @@ # Prefer omitting the `catch` binding parameter -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-prototype-methods.md b/docs/rules/prefer-prototype-methods.md index 89f8f1af62..1666278a6c 100644 --- a/docs/rules/prefer-prototype-methods.md +++ b/docs/rules/prefer-prototype-methods.md @@ -1,6 +1,6 @@ # Prefer borrowing methods from the prototype instead of the instance -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-query-selector.md b/docs/rules/prefer-query-selector.md index a31f583d81..e8a2e9882e 100644 --- a/docs/rules/prefer-query-selector.md +++ b/docs/rules/prefer-query-selector.md @@ -1,6 +1,6 @@ # Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-reflect-apply.md b/docs/rules/prefer-reflect-apply.md index 54d6f5d243..ca40f93f31 100644 --- a/docs/rules/prefer-reflect-apply.md +++ b/docs/rules/prefer-reflect-apply.md @@ -1,6 +1,6 @@ # Prefer `Reflect.apply()` over `Function#apply()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-regexp-test.md b/docs/rules/prefer-regexp-test.md index ee714ac534..cbb32d6a75 100644 --- a/docs/rules/prefer-regexp-test.md +++ b/docs/rules/prefer-regexp-test.md @@ -1,6 +1,6 @@ # Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-set-has.md b/docs/rules/prefer-set-has.md index f4a5070f13..e0aec4f902 100644 --- a/docs/rules/prefer-set-has.md +++ b/docs/rules/prefer-set-has.md @@ -1,6 +1,6 @@ # Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-set-size.md b/docs/rules/prefer-set-size.md index 86e76b393b..d53c266846 100644 --- a/docs/rules/prefer-set-size.md +++ b/docs/rules/prefer-set-size.md @@ -1,6 +1,6 @@ # Prefer using `Set#size` instead of `Array#length` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-spread.md b/docs/rules/prefer-spread.md index 2f118204b3..8a8e1e8f16 100644 --- a/docs/rules/prefer-spread.md +++ b/docs/rules/prefer-spread.md @@ -1,6 +1,6 @@ # Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-string-replace-all.md b/docs/rules/prefer-string-replace-all.md index 001acabfe0..909c6f9691 100644 --- a/docs/rules/prefer-string-replace-all.md +++ b/docs/rules/prefer-string-replace-all.md @@ -1,6 +1,6 @@ # Prefer `String#replaceAll()` over regex searches with the global flag -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-string-slice.md b/docs/rules/prefer-string-slice.md index 66440c2b01..5901a49485 100644 --- a/docs/rules/prefer-string-slice.md +++ b/docs/rules/prefer-string-slice.md @@ -1,6 +1,6 @@ # Prefer `String#slice()` over `String#substr()` and `String#substring()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-string-starts-ends-with.md b/docs/rules/prefer-string-starts-ends-with.md index 2c41311dd9..bba16c0613 100644 --- a/docs/rules/prefer-string-starts-ends-with.md +++ b/docs/rules/prefer-string-starts-ends-with.md @@ -1,6 +1,6 @@ # Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-string-trim-start-end.md b/docs/rules/prefer-string-trim-start-end.md index 5d5df7753c..9c85efa9bc 100644 --- a/docs/rules/prefer-string-trim-start-end.md +++ b/docs/rules/prefer-string-trim-start-end.md @@ -1,6 +1,6 @@ # Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-switch.md b/docs/rules/prefer-switch.md index 9753b4c96e..1d90f8bd08 100644 --- a/docs/rules/prefer-switch.md +++ b/docs/rules/prefer-switch.md @@ -1,6 +1,6 @@ # Prefer `switch` over multiple `else-if` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-ternary.md b/docs/rules/prefer-ternary.md index 6d69da1753..dadc611320 100644 --- a/docs/rules/prefer-ternary.md +++ b/docs/rules/prefer-ternary.md @@ -1,6 +1,6 @@ # Prefer ternary expressions over simple `if-else` statements -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-top-level-await.md b/docs/rules/prefer-top-level-await.md index 83a0c4ca7b..cf34974e79 100644 --- a/docs/rules/prefer-top-level-await.md +++ b/docs/rules/prefer-top-level-await.md @@ -1,6 +1,6 @@ # Prefer top-level await over top-level promises and async function calls -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-type-error.md b/docs/rules/prefer-type-error.md index 0ed7a3d8d7..0ab23ce712 100644 --- a/docs/rules/prefer-type-error.md +++ b/docs/rules/prefer-type-error.md @@ -1,6 +1,6 @@ # Enforce throwing `TypeError` in type checking conditions -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prevent-abbreviations.md b/docs/rules/prevent-abbreviations.md index 69f274b523..d511363c8d 100644 --- a/docs/rules/prevent-abbreviations.md +++ b/docs/rules/prevent-abbreviations.md @@ -1,6 +1,6 @@ # Prevent abbreviations -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/relative-url-style.md b/docs/rules/relative-url-style.md index 822a6b0bee..c2e3bd523d 100644 --- a/docs/rules/relative-url-style.md +++ b/docs/rules/relative-url-style.md @@ -1,6 +1,6 @@ # Enforce consistent relative URL style -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/require-array-join-separator.md b/docs/rules/require-array-join-separator.md index 2b2d0daece..ec9d20c5e9 100644 --- a/docs/rules/require-array-join-separator.md +++ b/docs/rules/require-array-join-separator.md @@ -1,6 +1,6 @@ # Enforce using the separator argument with `Array#join()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-number-to-fixed-digits-argument.md b/docs/rules/require-number-to-fixed-digits-argument.md index 6f1a74dd22..73763f770e 100644 --- a/docs/rules/require-number-to-fixed-digits-argument.md +++ b/docs/rules/require-number-to-fixed-digits-argument.md @@ -1,6 +1,6 @@ # Enforce using the digits argument with `Number#toFixed()` -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-post-message-target-origin.md b/docs/rules/require-post-message-target-origin.md index c1e2645e2d..101727ed24 100644 --- a/docs/rules/require-post-message-target-origin.md +++ b/docs/rules/require-post-message-target-origin.md @@ -1,6 +1,6 @@ # Enforce using the `targetOrigin` argument with `window.postMessage()` -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/string-content.md b/docs/rules/string-content.md index 3a2ea1f3e8..6af2f7405f 100644 --- a/docs/rules/string-content.md +++ b/docs/rules/string-content.md @@ -1,6 +1,6 @@ # Enforce better string content -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/switch-case-braces.md b/docs/rules/switch-case-braces.md index d20302b9dd..8f7ac3ae8d 100644 --- a/docs/rules/switch-case-braces.md +++ b/docs/rules/switch-case-braces.md @@ -1,6 +1,6 @@ # Enforce consistent brace style for `case` clauses -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/template-indent.md b/docs/rules/template-indent.md index 804b968917..b6fbb40be7 100644 --- a/docs/rules/template-indent.md +++ b/docs/rules/template-indent.md @@ -1,6 +1,6 @@ # Fix whitespace-insensitive template indentation -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/text-encoding-identifier-case.md b/docs/rules/text-encoding-identifier-case.md index f365bbb594..96391013f7 100644 --- a/docs/rules/text-encoding-identifier-case.md +++ b/docs/rules/text-encoding-identifier-case.md @@ -1,6 +1,6 @@ # Enforce consistent case for text encoding identifiers -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/throw-new-error.md b/docs/rules/throw-new-error.md index 37b7b75478..33e60fd883 100644 --- a/docs/rules/throw-new-error.md +++ b/docs/rules/throw-new-error.md @@ -1,6 +1,6 @@ # Require `new` when throwing an error -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). +πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/readme.md b/readme.md index c84e1aa3ad..607b27f92e 100644 --- a/readme.md +++ b/readme.md @@ -104,7 +104,7 @@ If you don't use the preset, ensure you use the same `env` and `parserOptions` c πŸ’Ό [Configurations](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs) enabled in.\ -βœ… Set in the `recommended` [configuration](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).\ +βœ… Set in the `recommended` [configuration](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs).\ πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/rules/expiring-todo-comments.js b/rules/expiring-todo-comments.js index 1a069dc880..2dcc53fe70 100644 --- a/rules/expiring-todo-comments.js +++ b/rules/expiring-todo-comments.js @@ -186,7 +186,15 @@ function getPackageHelpers(dirname) { return afterArguments; } - return {packageResult, hasPackage, packageJson, packageDependencies, parseArgument, parseTodoMessage, parseTodoWithArguments}; + return { + packageResult, + hasPackage, + packageJson, + packageDependencies, + parseArgument, + parseTodoMessage, + parseTodoWithArguments, + }; } const DEPENDENCY_INCLUSION_RE = /^[+-]\s*@?\S+\/?\S+/; @@ -197,7 +205,7 @@ const ISO8601_DATE = /\d{4}-\d{2}-\d{2}/; function createArgumentGroup(arguments_) { const groups = {}; for (const {value, type} of arguments_) { - groups[type] = groups[type] || []; + groups[type] ??= []; groups[type].push(value); } diff --git a/rules/explicit-length-check.js b/rules/explicit-length-check.js index 86a6cc7aea..96352bcfa5 100644 --- a/rules/explicit-length-check.js +++ b/rules/explicit-length-check.js @@ -194,7 +194,12 @@ function create(context) { } if (node) { - return getProblem({node, isZeroLengthCheck, lengthNode, autoFix}); + return getProblem({ + node, + isZeroLengthCheck, + lengthNode, + autoFix, + }); } }, }; diff --git a/rules/no-array-for-each.js b/rules/no-array-for-each.js index 0bc633835d..9674929299 100644 --- a/rules/no-array-for-each.js +++ b/rules/no-array-for-each.js @@ -347,7 +347,12 @@ function isFixable(callExpression, {scope, functionInfo, allIdentifiers, sourceC // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1814 || (parameters.length === 2 && parameters[1].type !== 'Identifier') || parameters.some(({type, typeAnnotation}) => type === 'RestElement' || typeAnnotation) - || !isFunctionParametersSafeToFix(callback, {scope, callExpression, allIdentifiers, sourceCode}) + || !isFunctionParametersSafeToFix(callback, { + scope, + callExpression, + allIdentifiers, + sourceCode, + }) ) { return false; } @@ -434,7 +439,12 @@ const create = context => { messageId: MESSAGE_ID_ERROR, }; - if (!isFixable(node, {scope, allIdentifiers, functionInfo, sourceCode})) { + if (!isFixable(node, { + scope, + allIdentifiers, + functionInfo, + sourceCode, + })) { yield problem; continue; } diff --git a/rules/no-useless-promise-resolve-reject.js b/rules/no-useless-promise-resolve-reject.js index e96daed3b4..f0d36c57be 100644 --- a/rules/no-useless-promise-resolve-reject.js +++ b/rules/no-useless-promise-resolve-reject.js @@ -111,7 +111,7 @@ function fix(callExpression, isInTryStatement, sourceCode) { if (isReject) { // `return Promise.reject()` -> `throw undefined` - text = text || 'undefined'; + text ||= 'undefined'; text = `throw ${text}`; if (isYieldExpression) { @@ -143,7 +143,7 @@ function fix(callExpression, isInTryStatement, sourceCode) { } // `=> Promise.resolve()` -> `=> {}` - text = text || '{}'; + text ||= '{}'; } } diff --git a/rules/prefer-add-event-listener.js b/rules/prefer-add-event-listener.js index 85a132d239..2a957d2367 100644 --- a/rules/prefer-add-event-listener.js +++ b/rules/prefer-add-event-listener.js @@ -89,7 +89,7 @@ const create = context => { }, ReturnStatement(node) { - codePathInfo.returnsSomething = codePathInfo.returnsSomething || Boolean(node.argument); + codePathInfo.returnsSomething ||= Boolean(node.argument); }, 'AssignmentExpression:exit'(node) { diff --git a/rules/prefer-export-from.js b/rules/prefer-export-from.js index 5fb9455784..789174bbd4 100644 --- a/rules/prefer-export-from.js +++ b/rules/prefer-export-from.js @@ -126,9 +126,7 @@ function getFixFunction({ exportDeclaration = exportDeclarations.find(({source, exportKind}) => source.value === sourceValue && exportKind === 'type'); } - if (!exportDeclaration) { - exportDeclaration = exportDeclarations.find(({source, exportKind}) => source.value === sourceValue && exportKind !== 'type'); - } + exportDeclaration ||= exportDeclarations.find(({source, exportKind}) => source.value === sourceValue && exportKind !== 'type'); /** @param {import('eslint').Rule.RuleFixer} fixer */ return function * (fixer) { diff --git a/rules/prefer-string-slice.js b/rules/prefer-string-slice.js index e4b9419e3f..d2d09ef837 100644 --- a/rules/prefer-string-slice.js +++ b/rules/prefer-string-slice.js @@ -162,7 +162,12 @@ const create = context => ({ } const fixArguments = method === 'substr' ? fixSubstrArguments : fixSubstringArguments; - yield * fixArguments({node, fixer, context, abort}); + yield * fixArguments({ + node, + fixer, + context, + abort, + }); }, }; }, diff --git a/rules/string-content.js b/rules/string-content.js index 646d6f696f..39d99b9627 100644 --- a/rules/string-content.js +++ b/rules/string-content.js @@ -166,7 +166,8 @@ const schema = [ additionalProperties: false, }, ], - }}, + }, + }, }, }, ]; diff --git a/rules/utils/numeric.js b/rules/utils/numeric.js index 7b4571971f..02a2f40265 100644 --- a/rules/utils/numeric.js +++ b/rules/utils/numeric.js @@ -31,7 +31,12 @@ function parseNumber(text) { power = '', } = text.match(/^(?[\d._]*?)(?:(?[Ee])(?[+-])?(?[\d_]+))?$/).groups; - return {number, mark, sign, power}; + return { + number, + mark, + sign, + power, + }; } function parseFloatNumber(text) { diff --git a/rules/utils/rule.js b/rules/utils/rule.js index 26eaf676ee..46581a55b6 100644 --- a/rules/utils/rule.js +++ b/rules/utils/rule.js @@ -47,15 +47,11 @@ function reportListenerProblems(problems, context) { continue; } - if (problem.fix) { - problem.fix = wrapFixFunction(problem.fix); - } + problem.fix &&= wrapFixFunction(problem.fix); if (Array.isArray(problem.suggest)) { for (const suggest of problem.suggest) { - if (suggest.fix) { - suggest.fix = wrapFixFunction(suggest.fix); - } + suggest.fix &&= wrapFixFunction(suggest.fix); suggest.data = { ...problem.data, diff --git a/test/consistent-function-scoping.mjs b/test/consistent-function-scoping.mjs index 6ec71dc2dd..59aef7de72 100644 --- a/test/consistent-function-scoping.mjs +++ b/test/consistent-function-scoping.mjs @@ -596,31 +596,80 @@ test({ // Function kinds and names, loc { code: 'function foo() { function bar() {} }', - errors: [createError('function \'bar\'', {line: 1, column: 18, endLine: 1, endColumn: 30})], + errors: [ + createError('function \'bar\'', { + line: 1, + column: 18, + endLine: 1, + endColumn: 30, + }), + ], }, { code: 'function foo() { async function bar() {} }', - errors: [createError('async function \'bar\'', {line: 1, column: 18, endLine: 1, endColumn: 36})], + errors: [ + createError('async function \'bar\'', { + line: 1, + column: 18, + endLine: 1, + endColumn: 36, + }), + ], }, { code: 'function foo() { function* bar() {} }', - errors: [createError('generator function \'bar\'', {line: 1, column: 18, endLine: 1, endColumn: 31})], + errors: [ + createError('generator function \'bar\'', { + line: 1, + column: 18, + endLine: 1, + endColumn: 31, + }), + ], }, { code: 'function foo() { async function* bar() {} }', - errors: [createError('async generator function \'bar\'', {line: 1, column: 18, endLine: 1, endColumn: 37})], + errors: [ + createError('async generator function \'bar\'', { + line: 1, + column: 18, + endLine: 1, + endColumn: 37, + }), + ], }, { code: 'function foo() { const bar = () => {} }', - errors: [createError('arrow function \'bar\'', {line: 1, column: 33, endLine: 1, endColumn: 35})], + errors: [ + createError('arrow function \'bar\'', { + line: 1, + column: 33, + endLine: 1, + endColumn: 35, + }), + ], }, { code: 'const doFoo = () => bar => bar;', - errors: [createError('arrow function', {line: 1, column: 25, endLine: 1, endColumn: 27})], + errors: [ + createError('arrow function', { + line: 1, + column: 25, + endLine: 1, + endColumn: 27, + }), + ], }, { code: 'function foo() { const bar = async () => {} }', - errors: [createError('async arrow function \'bar\'', {line: 1, column: 39, endLine: 1, endColumn: 41})], + errors: [ + createError('async arrow function \'bar\'', { + line: 1, + column: 39, + endLine: 1, + endColumn: 41, + }), + ], }, // Actual message { diff --git a/test/utils/parsers.mjs b/test/utils/parsers.mjs index 613516f331..59e4d43bfa 100644 --- a/test/utils/parsers.mjs +++ b/test/utils/parsers.mjs @@ -6,9 +6,9 @@ const babelParser = { name: 'babel', implementation: babelEslintParser, mergeParserOptions(options) { - options = options || {}; - options.babelOptions = options.babelOptions || {}; - options.babelOptions.parserOpts = options.babelOptions.parserOpts || {}; + options ??= {}; + options.babelOptions ??= {}; + options.babelOptions.parserOpts ??= {}; let babelPlugins = options.babelOptions.parserOpts.plugins || []; babelPlugins = [ diff --git a/test/utils/test.mjs b/test/utils/test.mjs index 25856e9091..638a22536b 100644 --- a/test/utils/test.mjs +++ b/test/utils/test.mjs @@ -149,7 +149,7 @@ const addComment = (testCase, comment) => { ...testCase, code: `${code}\n/* ${comment} */`, }; - if (Object.prototype.hasOwnProperty.call(fixedTest, 'output') && typeof output === 'string') { + if (Object.hasOwn(fixedTest, 'output') && typeof output === 'string') { fixedTest.output = `${output}\n/* ${comment} */`; }