Skip to content
Permalink

Comparing changes

Choose two branches to see whatโ€™s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sindresorhus/eslint-plugin-unicorn
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v57.0.0
Choose a base ref
...
head repository: sindresorhus/eslint-plugin-unicorn
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v58.0.0
Choose a head ref
  • 18 commits
  • 172 files changed
  • 8 contributors

Commits on Feb 18, 2025

  1. prevent-abbreviations: Preserve iOS (#2560)

    ChickenF622 authored Feb 18, 2025

    Verified

    This commit was signed with the committerโ€™s verified signature.
    JamesNK James Newton-King
    Copy the full SHA
    e8798da View commit details

Commits on Feb 19, 2025

  1. Fix coverage report (#2566)

    fisker authored Feb 19, 2025

    Verified

    This commit was signed with the committerโ€™s verified signature.
    JamesNK James Newton-King
    Copy the full SHA
    0b2086f View commit details

Commits on Feb 22, 2025

  1. Replace FlatESLint with ESLint (#2569)

    fisker authored Feb 22, 2025
    Copy the full SHA
    9579081 View commit details
  2. Use new deprecatedInfo (#2568)

    fisker authored Feb 22, 2025
    Copy the full SHA
    bd185a2 View commit details
  3. no-abusive-eslint-disable: Use ConfigCommentParser from `@eslint/โ€ฆ

    โ€ฆplugin-kit` to parse comments (#2571)
    fisker authored Feb 22, 2025
    Copy the full SHA
    0522c91 View commit details

Commits on Feb 25, 2025

  1. Fix eslint-remote-tester-config path

    fisker committed Feb 25, 2025
    Copy the full SHA
    762670f View commit details

Commits on Feb 27, 2025

  1. no-accessor-recursion: Fix exception when used in CommonJS (#2574)

    Co-authored-by: fisker <lionkay@gmail.com>
    axetroy and fisker authored Feb 27, 2025
    Copy the full SHA
    ca1e432 View commit details
  2. Add tests for import attributes with with keyword (#2576)

    fisker authored Feb 27, 2025
    Copy the full SHA
    b1cc894 View commit details
  3. Update dependencies (#2575)

    fisker authored Feb 27, 2025
    Copy the full SHA
    988394c View commit details

Commits on Mar 2, 2025

  1. Update engines.node to match real compatibility (#2581)

    fregante authored Mar 2, 2025
    Copy the full SHA
    e48a620 View commit details

Commits on Mar 3, 2025

  1. no-unnecessary-polyfills: Fix crash on checking es6-error module (#โ€ฆ

    fisker authored Mar 3, 2025
    Copy the full SHA
    66de41a View commit details

Commits on Mar 4, 2025

  1. Fix integration test for rule examples section

    sindresorhus committed Mar 4, 2025
    Copy the full SHA
    4b1c0c0 View commit details

Commits on Mar 8, 2025

  1. Fix broken links (#2588)

    9romise authored Mar 8, 2025
    Copy the full SHA
    46b3628 View commit details
  2. Add options to escape-case and number-literal-case (#2559)

    Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
    otomad and sindresorhus authored Mar 8, 2025
    Copy the full SHA
    0f6048c View commit details

Commits on Mar 19, 2025

  1. Update dependencies (#2597)

    fisker authored Mar 19, 2025
    Copy the full SHA
    563d45c View commit details
  2. Forbid .range (#2599)

    fisker authored Mar 19, 2025
    Copy the full SHA
    dbe2bb2 View commit details

Commits on Mar 22, 2025

  1. no-unnecessary-polyfills: Fix browserslist field name (#2603)

    azat-io authored Mar 22, 2025
    Copy the full SHA
    1a4c76f View commit details

Commits on Mar 24, 2025

  1. 58.0.0

    sindresorhus committed Mar 24, 2025
    Copy the full SHA
    2c7c761 View commit details
Showing with 1,097 additions and 515 deletions.
  1. +1 โˆ’1 .eslint-doc-generatorrc.js
  2. +1 โˆ’0 .github/workflows/main.yml
  3. +1 โˆ’1 .github/workflows/smoke-test.yml
  4. +0 โˆ’8 .npmpackagejsonlintrc.json
  5. +2 โˆ’2 docs/deprecated-rules.md
  6. +1 โˆ’1 docs/rules/better-regex.md
  7. +1 โˆ’1 docs/rules/catch-error-name.md
  8. +1 โˆ’1 docs/rules/consistent-assert.md
  9. +1 โˆ’1 docs/rules/consistent-date-clone.md
  10. +1 โˆ’1 docs/rules/consistent-destructuring.md
  11. +1 โˆ’1 docs/rules/consistent-empty-array-spread.md
  12. +1 โˆ’1 docs/rules/consistent-existence-index-check.md
  13. +1 โˆ’1 docs/rules/consistent-function-scoping.md
  14. +1 โˆ’1 docs/rules/custom-error-definition.md
  15. +1 โˆ’1 docs/rules/empty-brace-spaces.md
  16. +1 โˆ’1 docs/rules/error-message.md
  17. +71 โˆ’5 docs/rules/escape-case.md
  18. +1 โˆ’1 docs/rules/expiring-todo-comments.md
  19. +1 โˆ’1 docs/rules/explicit-length-check.md
  20. +1 โˆ’1 docs/rules/filename-case.md
  21. +1 โˆ’1 docs/rules/import-style.md
  22. +1 โˆ’1 docs/rules/new-for-builtins.md
  23. +1 โˆ’1 docs/rules/no-abusive-eslint-disable.md
  24. +1 โˆ’1 docs/rules/no-accessor-recursion.md
  25. +1 โˆ’1 docs/rules/no-anonymous-default-export.md
  26. +1 โˆ’1 docs/rules/no-array-callback-reference.md
  27. +1 โˆ’1 docs/rules/no-array-for-each.md
  28. +1 โˆ’1 docs/rules/no-array-method-this-argument.md
  29. +1 โˆ’1 docs/rules/no-array-push-push.md
  30. +1 โˆ’1 docs/rules/no-array-reduce.md
  31. +1 โˆ’1 docs/rules/no-await-expression-member.md
  32. +1 โˆ’1 docs/rules/no-await-in-promise-methods.md
  33. +1 โˆ’1 docs/rules/no-console-spaces.md
  34. +1 โˆ’1 docs/rules/no-document-cookie.md
  35. +1 โˆ’1 docs/rules/no-empty-file.md
  36. +1 โˆ’1 docs/rules/no-for-loop.md
  37. +1 โˆ’1 docs/rules/no-hex-escape.md
  38. +1 โˆ’1 docs/rules/no-instanceof-builtins.md
  39. +1 โˆ’1 docs/rules/no-invalid-fetch-options.md
  40. +1 โˆ’1 docs/rules/no-invalid-remove-event-listener.md
  41. +1 โˆ’1 docs/rules/no-keyword-prefix.md
  42. +1 โˆ’1 docs/rules/no-length-as-slice-end.md
  43. +1 โˆ’1 docs/rules/no-lonely-if.md
  44. +1 โˆ’1 docs/rules/no-magic-array-flat-depth.md
  45. +1 โˆ’1 docs/rules/no-named-default.md
  46. +1 โˆ’1 docs/rules/no-negated-condition.md
  47. +1 โˆ’1 docs/rules/no-negation-in-equality-check.md
  48. +1 โˆ’1 docs/rules/no-nested-ternary.md
  49. +1 โˆ’1 docs/rules/no-new-array.md
  50. +1 โˆ’1 docs/rules/no-new-buffer.md
  51. +1 โˆ’1 docs/rules/no-null.md
  52. +1 โˆ’1 docs/rules/no-object-as-default-parameter.md
  53. +1 โˆ’1 docs/rules/no-process-exit.md
  54. +1 โˆ’1 docs/rules/no-single-promise-in-promise-methods.md
  55. +1 โˆ’1 docs/rules/no-static-only-class.md
  56. +1 โˆ’1 docs/rules/no-thenable.md
  57. +1 โˆ’1 docs/rules/no-this-assignment.md
  58. +1 โˆ’1 docs/rules/no-typeof-undefined.md
  59. +1 โˆ’1 docs/rules/no-unnecessary-await.md
  60. +3 โˆ’3 docs/rules/no-unnecessary-polyfills.md
  61. +1 โˆ’1 docs/rules/no-unreadable-array-destructuring.md
  62. +1 โˆ’1 docs/rules/no-unreadable-iife.md
  63. +1 โˆ’1 docs/rules/no-unused-properties.md
  64. +1 โˆ’1 docs/rules/no-useless-fallback-in-spread.md
  65. +1 โˆ’1 docs/rules/no-useless-length-check.md
  66. +1 โˆ’1 docs/rules/no-useless-promise-resolve-reject.md
  67. +1 โˆ’1 docs/rules/no-useless-spread.md
  68. +1 โˆ’1 docs/rules/no-useless-switch-case.md
  69. +1 โˆ’1 docs/rules/no-useless-undefined.md
  70. +1 โˆ’1 docs/rules/no-zero-fractions.md
  71. +54 โˆ’14 docs/rules/number-literal-case.md
  72. +1 โˆ’1 docs/rules/numeric-separators-style.md
  73. +1 โˆ’1 docs/rules/prefer-add-event-listener.md
  74. +1 โˆ’1 docs/rules/prefer-array-find.md
  75. +1 โˆ’1 docs/rules/prefer-array-flat-map.md
  76. +1 โˆ’1 docs/rules/prefer-array-flat.md
  77. +1 โˆ’1 docs/rules/prefer-array-index-of.md
  78. +1 โˆ’1 docs/rules/prefer-array-some.md
  79. +1 โˆ’1 docs/rules/prefer-at.md
  80. +1 โˆ’1 docs/rules/prefer-blob-reading-methods.md
  81. +1 โˆ’1 docs/rules/prefer-code-point.md
  82. +1 โˆ’1 docs/rules/prefer-date-now.md
  83. +1 โˆ’1 docs/rules/prefer-default-parameters.md
  84. +1 โˆ’1 docs/rules/prefer-dom-node-append.md
  85. +1 โˆ’1 docs/rules/prefer-dom-node-dataset.md
  86. +1 โˆ’1 docs/rules/prefer-dom-node-remove.md
  87. +1 โˆ’1 docs/rules/prefer-dom-node-text-content.md
  88. +1 โˆ’1 docs/rules/prefer-event-target.md
  89. +1 โˆ’1 docs/rules/prefer-export-from.md
  90. +1 โˆ’1 docs/rules/prefer-global-this.md
  91. +1 โˆ’1 docs/rules/prefer-includes.md
  92. +1 โˆ’1 docs/rules/prefer-json-parse-buffer.md
  93. +1 โˆ’1 docs/rules/prefer-keyboard-event-key.md
  94. +1 โˆ’1 docs/rules/prefer-logical-operator-over-ternary.md
  95. +1 โˆ’1 docs/rules/prefer-math-min-max.md
  96. +1 โˆ’1 docs/rules/prefer-math-trunc.md
  97. +1 โˆ’1 docs/rules/prefer-modern-dom-apis.md
  98. +1 โˆ’1 docs/rules/prefer-modern-math-apis.md
  99. +1 โˆ’1 docs/rules/prefer-module.md
  100. +1 โˆ’1 docs/rules/prefer-native-coercion-functions.md
  101. +1 โˆ’1 docs/rules/prefer-negative-index.md
  102. +1 โˆ’1 docs/rules/prefer-node-protocol.md
  103. +1 โˆ’1 docs/rules/prefer-number-properties.md
  104. +1 โˆ’1 docs/rules/prefer-object-from-entries.md
  105. +1 โˆ’1 docs/rules/prefer-optional-catch-binding.md
  106. +1 โˆ’1 docs/rules/prefer-prototype-methods.md
  107. +1 โˆ’1 docs/rules/prefer-query-selector.md
  108. +1 โˆ’1 docs/rules/prefer-reflect-apply.md
  109. +1 โˆ’1 docs/rules/prefer-regexp-test.md
  110. +1 โˆ’1 docs/rules/prefer-set-has.md
  111. +1 โˆ’1 docs/rules/prefer-set-size.md
  112. +1 โˆ’1 docs/rules/prefer-spread.md
  113. +1 โˆ’1 docs/rules/prefer-string-raw.md
  114. +1 โˆ’1 docs/rules/prefer-string-replace-all.md
  115. +1 โˆ’1 docs/rules/prefer-string-slice.md
  116. +1 โˆ’1 docs/rules/prefer-string-starts-ends-with.md
  117. +1 โˆ’1 docs/rules/prefer-string-trim-start-end.md
  118. +1 โˆ’1 docs/rules/prefer-structured-clone.md
  119. +1 โˆ’1 docs/rules/prefer-switch.md
  120. +1 โˆ’1 docs/rules/prefer-ternary.md
  121. +1 โˆ’1 docs/rules/prefer-top-level-await.md
  122. +1 โˆ’1 docs/rules/prefer-type-error.md
  123. +1 โˆ’1 docs/rules/prevent-abbreviations.md
  124. +1 โˆ’1 docs/rules/relative-url-style.md
  125. +1 โˆ’1 docs/rules/require-array-join-separator.md
  126. +1 โˆ’1 docs/rules/require-number-to-fixed-digits-argument.md
  127. +1 โˆ’1 docs/rules/require-post-message-target-origin.md
  128. +1 โˆ’1 docs/rules/string-content.md
  129. +1 โˆ’1 docs/rules/switch-case-braces.md
  130. +1 โˆ’1 docs/rules/template-indent.md
  131. +1 โˆ’1 docs/rules/text-encoding-identifier-case.md
  132. +1 โˆ’1 docs/rules/throw-new-error.md
  133. +2 โˆ’2 eslint.config.js
  134. +5 โˆ’2 index.js
  135. +20 โˆ’20 package.json
  136. +3 โˆ’3 readme.md
  137. +24 โˆ’9 rules/escape-case.js
  138. +2 โˆ’2 rules/fix/fix-space-around-keywords.js
  139. +2 โˆ’2 rules/fix/remove-spaces-after.js
  140. +1 โˆ’0 rules/fix/replace-reference-identifier.js
  141. +2 โˆ’0 rules/fix/replace-string-raw.js
  142. +1 โˆ’0 rules/fix/replace-template-element.js
  143. +34 โˆ’22 rules/no-abusive-eslint-disable.js
  144. +1 โˆ’1 rules/no-accessor-recursion.js
  145. +1 โˆ’1 rules/no-static-only-class.js
  146. +2 โˆ’9 rules/no-thenable.js
  147. +5 โˆ’6 rules/no-unnecessary-polyfills.js
  148. +33 โˆ’5 rules/number-literal-case.js
  149. +3 โˆ’3 rules/prefer-at.js
  150. +8 โˆ’7 rules/prefer-node-protocol.js
  151. +1 โˆ’0 rules/prefer-switch.js
  152. +2 โˆ’0 rules/shared/abbreviations.js
  153. +19 โˆ’12 rules/utils/create-deprecated-rules.js
  154. +2 โˆ’0 rules/utils/has-same-range.js
  155. +2 โˆ’2 rules/utils/parentheses.js
  156. +7 โˆ’17 scripts/internal-rules/index.js
  157. +1 โˆ’2 scripts/internal-rules/no-restricted-property-access.js
  158. +0 โˆ’8 scripts/internal-rules/package.json
  159. +256 โˆ’49 test/escape-case.js
  160. +2 โˆ’4 test/integration/run-eslint.js
  161. +27 โˆ’5 test/no-abusive-eslint-disable.js
  162. +159 โˆ’136 test/no-accessor-recursion.js
  163. +1 โˆ’0 test/no-unnecessary-polyfills.js
  164. +41 โˆ’15 test/number-literal-case.js
  165. +17 โˆ’13 test/package.js
  166. +26 โˆ’0 test/prefer-export-from.js
  167. +6 โˆ’0 test/prefer-node-protocol.js
  168. +1 โˆ’0 test/prevent-abbreviations.js
  169. +17 โˆ’0 test/snapshots/no-abusive-eslint-disable.js.md
  170. BIN test/snapshots/no-abusive-eslint-disable.js.snap
  171. +104 โˆ’0 test/snapshots/prefer-export-from.js.md
  172. BIN test/snapshots/prefer-export-from.js.snap
2 changes: 1 addition & 1 deletion .eslint-doc-generatorrc.js
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ const config = {
'hasSuggestions',
'requiresTypeChecking',
],
urlConfigs: 'https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs',
urlConfigs: 'https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config',
// Workaround for https://github.com/bmish/eslint-doc-generator/issues/615
pathRuleDoc: '../docs/rules/{name}.md',
pathRuleList: '../readme.md',
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ jobs:
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
disable_search: true
files: coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
run-rules-on-codebase:
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
@@ -15,4 +15,4 @@ jobs:
- uses: AriPerkkio/eslint-remote-tester-run-action@v5
with:
issue-title: "Results of weekly scheduled smoke test"
eslint-remote-tester-config: test/smoke/eslint-remote-tester.config.mjs
eslint-remote-tester-config: test/smoke/eslint-remote-tester.config.js
8 changes: 0 additions & 8 deletions .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
@@ -8,14 +8,6 @@
"prefer-alphabetical-bundledDependencies": "error",
"prefer-alphabetical-scripts": "error",
"prefer-caret-version-dependencies": "error",
"prefer-caret-version-devDependencies": [
"error",
{
"exceptions": [
"eslint-plugin-internal-rules"
]
}
],
"prefer-scripts": [
"error",
[
4 changes: 2 additions & 2 deletions docs/deprecated-rules.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Deprecated Rules
# Deprecated/Removed Rules

## import-index

This rule is outdated. JavaScript modules (ESM) do not support importing a directory.

## no-array-instanceof

This rule was renamed to [`no-instanceof-array`](rules/no-instanceof-array.md) to be more correct.
Replaced by [`no-instanceof-builtins`](rules/no-instanceof-builtins.md) which covers more cases.

## no-fn-reference-in-iterator

2 changes: 1 addition & 1 deletion docs/rules/better-regex.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Improve regexes by making them shorter, consistent, and safer

๐Ÿšซ This rule is _disabled_ in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs).
๐Ÿšซ This rule is _disabled_ in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/catch-error-name.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/consistent-assert.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enforce consistent assertion style with `node:assert`

๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/consistent-date-clone.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prefer passing `Date` directly to the constructor when cloning

๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/consistent-destructuring.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿšซ This rule is _disabled_ in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง๐Ÿ’ก 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).

2 changes: 1 addition & 1 deletion docs/rules/consistent-empty-array-spread.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prefer consistent types when spreading a ternary in an array literal

๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/consistent-existence-index-check.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`

๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/consistent-function-scoping.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
2 changes: 1 addition & 1 deletion docs/rules/custom-error-definition.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿšซ This rule is _disabled_ in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/empty-brace-spaces.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/error-message.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
76 changes: 71 additions & 5 deletions docs/rules/escape-case.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,94 @@
# Require escape sequences to use uppercase values
# Require escape sequences to use uppercase or lowercase values

๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Enforces defining escape sequence values with uppercase characters rather than lowercase ones. This promotes readability by making the escaped value more distinguishable from the identifier.
Enforces a consistent escaped value style by defining escape sequence values with uppercase or lowercase characters. The default style is uppercase, which promotes readability by making the escaped value more distinguishable from the identifier.

## Fail
## Examples

```js
// โŒ
const foo = '\xa9';

// โœ…
const foo = '\xA9';
```

```js
// โŒ
const foo = '\ud834';

// โœ…
const foo = '\uD834';
```

```js
// โŒ
const foo = '\u{1d306}';

// โœ…
const foo = '\u{1D306}';
```

```js
// โŒ
const foo = '\ca';

// โœ…
const foo = '\cA';
```

## Pass
## Options

Type: `string`\
Default: `'uppercase'`

- `'uppercase'` (default)
- Always use escape sequence values with uppercase characters.
- `'lowercase'`
- Always use escape sequence values with lowercase characters.

Example:

```js
{
'unicorn/escape-case': ['error', 'lowercase']
}
```

```js
// โŒ
const foo = '\xA9';

// โœ…
const foo = '\xa9';
```

```js
// โŒ
const foo = '\uD834';

// โœ…
const foo = '\ud834';
```

```js
// โŒ
const foo = '\u{1D306}';

// โœ…
const foo = '\u{1d306}';
```

```js
// โŒ
const foo = '\cA';

// โœ…
const foo = '\ca';
```
2 changes: 1 addition & 1 deletion docs/rules/expiring-todo-comments.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
2 changes: 1 addition & 1 deletion docs/rules/explicit-length-check.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง๐Ÿ’ก 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).

2 changes: 1 addition & 1 deletion docs/rules/filename-case.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
2 changes: 1 addition & 1 deletion docs/rules/import-style.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
2 changes: 1 addition & 1 deletion docs/rules/new-for-builtins.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง๐Ÿ’ก 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).

2 changes: 1 addition & 1 deletion docs/rules/no-abusive-eslint-disable.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
2 changes: 1 addition & 1 deletion docs/rules/no-accessor-recursion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow recursive access to `this` within getters and setters

๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
2 changes: 1 addition & 1 deletion docs/rules/no-anonymous-default-export.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ’ก This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).

2 changes: 1 addition & 1 deletion docs/rules/no-array-callback-reference.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ’ก This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).

2 changes: 1 addition & 1 deletion docs/rules/no-array-for-each.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง๐Ÿ’ก 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).

2 changes: 1 addition & 1 deletion docs/rules/no-array-method-this-argument.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง๐Ÿ’ก 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).

2 changes: 1 addition & 1 deletion docs/rules/no-array-push-push.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง๐Ÿ’ก 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).

2 changes: 1 addition & 1 deletion docs/rules/no-array-reduce.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
2 changes: 1 addition & 1 deletion docs/rules/no-await-expression-member.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/no-await-in-promise-methods.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ’ก This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).

2 changes: 1 addition & 1 deletion docs/rules/no-console-spaces.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

2 changes: 1 addition & 1 deletion docs/rules/no-document-cookie.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
2 changes: 1 addition & 1 deletion docs/rules/no-empty-file.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow empty files

๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
2 changes: 1 addition & 1 deletion docs/rules/no-for-loop.md
Original file line number Diff line number Diff line change
@@ -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-eslintconfigjs).
๐Ÿ’ผ This rule is enabled in the โœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config).

๐Ÿ”ง๐Ÿ’ก 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).

Loading