Releases: sindresorhus/eslint-plugin-unicorn
Releases · sindresorhus/eslint-plugin-unicorn
v24.0.0
New rules
Improvements
prevent-abbreviations
: Addignore
option (#891) 898fcb4no-useless-undefined
: AddcheckArguments
option (#877) a1617b9consistent-function-scoping
: Allow ignoring arrow functions (#932) 17bf27c- Rewrite
error-message
rule (#922) 877bef9 - Improve
prefer-query-selector
rule (#908) 635601d prevent-abbreviations
: Addvar
/vars
replacements (#894) 07dadf5prevent-abbreviations
: Addver
→version
replacement (#870) e755cddprefer-number-properties
: Supportcomputed
key ofClassProperty
MethodDefinition
Property
(#886) 769ac35prefer-optional-catch-binding
: Improve output (#884) 375d11ano-null
: ExcludeuseRef(null)
andReact.useRef(null)
(#890) 7a4dbf4prefer-number-properties
: AddInfinity
support (#874) 643169bno-console-spaces
: Improve report location (#866) 190cbacno-useless-undefined
: IgnoretoHaveBeenCalledWith
method (#876) d10a641prefer-replace-all
: Handleu
flag (#879) d98d867no-for-loop
: Improve output when using the TypeScript parser (#883) 52edd3bno-for-loop
: Respect declaration kind (#878) df3f7bdno-for-loop
: Only report on the for loop head part (#885) e9c6963
Fixes
- Fix
false
import styles seen in reported problem messages (#910) d669707 import-style
: Fix crash onbabel-eslint
parser (#927) 9f5f721prevent-abbreviations
: Fix crash with TypeScript parser (#913) 9d5eca6prefer-query-selector
: Fix crash on calling without argument (#906) 36908daimport-style
: Fix crash on destructing require (#904) 8335d41new-for-builtins
: Remove auto-fix fornew String
,new Boolean()
, andnew Number()
(#907) dfc1ce0
v23.0.0
New rules
- Add
prefer-math-trunc
rule (#851) 5ee2432 - Add
numeric-separators-style
rule (#833) 6c9b531 - Add
prefer-ternary
rule (#514) d59cf95
Improvements
explicit-length-check
: Use'non-zero': 'greater-than'
by default (#850) 7c5df5fprevent-abbreviations
: Addfn
/func
->function
,i
/idx
/j
->index
replacements (#836) e502f42consistent-function-scoping
: Check anonymous functions (#835) 29ecbf6no-console-spaces
: Make space position more specific (#838) e17a63fno-nested-ternary
: Improve report location & message (#844) ca1afa6- Track JSX presence per-function, fixing some false negatives (#830) 85d424c
Fixes
v22.0.0
New rules
- Add
import-style
rule (#789) 0c7a199
Improvements
- Allow
Children
inno-fn-reference-in-iterator
(#809) 036e440 filename-case
: Ignore more index files (#826) 64d03a5- Update
ecmaVersion
to2021
(#820) a78cea3
Fixes
v21.0.0
New rules
- Add
prefer-array-find
rule (#735) 12b46da - Add
no-object-as-default-parameter
rule (#633) 9989d2d
Improvements
- Add
ev
toevent
default replacement toprevent-abbreviations
rule (#793) a0b4aba - Ignore more types in
no-fn-reference-in-iterator
andno-reduce
rule (#756) 5159c24 - Make
unicorn/prefer-flat-map
not enabled by default in the recommended config 655220a - Improve
consistent-function-scoping
report location (#778) df218a2 - Improve
consistent-function-scoping
message (#773) 4ed2adf
Fixes
v20.1.0
v20.0.0
Breaking
New rules
- Add
prefer-optional-catch-binding
rule (#671) efdb03a - Add
no-useless-undefined
rule (#718) 30dbe6d - Add
no-reduce
rule (#704) 06ed7ee
Improvements
throw-new-error
: CheckMemberExpression
customError (#716) a28aad5prefer-starts-ends-with
: Add auto-fix (#711) da978e3consistent-function-scoping
: Ignore IIFE (#707) 1f4413dprefer-set-has
: Ignore arrays only checking existence once (#706) 54c6f54
Fixes
v19.0.1
v19.0.0
New rules
Breaking
string-content
: Make it have no default patterns (#637) 08fad55catch-error-name
: ReplacecaughtErrorsIgnorePattern
option with anignore
option (#661) 5a27f04
Improvements
custom-error-definition
: Support class properties (#673) 9cc8d60catch-error-name
: SupportPromise#then
(#660) edcf73cprefer-set-has
: Supports more types of array (#641) 29f3c9c
Fixes
escape-case
: Fix missing characters (#678) d986427no-nested-ternary
: Fix incorrect result with TypeScript parser (#664) cb08ed0custom-error-definition
: Fix duplicated reports onthis.message
assign (#669) aa00647custom-error-definition
: Fix crash on@typescript-eslint/parser
(#659) e8cb921catch-error-name
: Improve error message (#665) 8ac9a90catch-error-name
: Fix error renaming (#654) cc2d1b1catch-error-name
: Only allow_
when it's not used (#650) 0c31a0bcatch-error-name
: Ignore destructuring (#649) b2838fd
v18.0.1
v18.0.0
New rules
- Add
prefer-number-properties
rule (#622) 8d8ce43 - Add
prefer-set-has
rule (#604) 9fa8de1
Improvements
- Add
ignore
option toexpiring-todo-comment
rule (#555) 08fabf6
Fixes
no-console-spaces
: Fix crash on string contains\n
(#629) 9cd01cdexplicit-length-check
: Ignore computedlength
ofMemberExpression
(#620) 418e072prefer-spread
: Insert semicolon in more cases (#615) de48b3dcatch-error-name
: KeeptypeAnnotation
when replacingidentifier
(#613) 446ff37prevent-abbreviations
: Fix crash onTypeParameter
with default value (#606) 2ef7a21prevent-abbreviations
: Add global variables check (#603) b5c0a12- Update
regexp-tree
to fix whitespace rewrite (#605) 2b78a17