Releases: sindresorhus/eslint-plugin-unicorn
Releases · sindresorhus/eslint-plugin-unicorn
v27.0.0
New rules
no-array-for-each
(#1017) 719cd00no-array-push-push
(#1015) 21537d7no-this-assignment
(#1018) 62a2f92
Improvements
prefer-ternary
: Addonly-single-line
option (#1025) 306c9e7numeric-separators-style
: AddonlyIfContainsSeparator
option (#916) 8d32574prefer-spread
: Prefer...
overArray#concat()
(#1029) cda72bdprefer-spread
: Fix more.concat
cases (#1042) c3c7ba3no-array-callback-reference
: Improve suggestions forArray#forEach()
(#1049) 77bcdc6no-new-buffer
: Use suggestion for unknown arguments (#1037) 88a724cno-unreadable-array-destructuring
: Add auto-fix (#1010) 27bc3c3new-for-builtins
: Better auto-fix (#1022) 5ba0f83no-instanceof-array
: Better auto-fix (#1020) 0520f31
Fixes
v26.0.1
v26.0.0
New rules
no-new-array
(#992) 48390c1prefer-array-index-of
(#920) 517a782prefer-regexp-test
(#970) 7b74b40consistent-destructuring
(#325) 32bd31c
Improvements
- Remove
import-index
rule from recommended preset (#977) ff1cd2e prefer-string-starts-ends-with
: Remove check onString#match()
(#1002) c9fa8b1no-array-callback-reference
: IgnoreAwaitExpression
exceptreduce
andreduceRight
(#814) 4c2b00b
Fixes
v25.0.1
v25.0.0
New rules
Renamed rules
We improved the naming and name consistency of some rules. Sorry about the churn.
If you use the recommended preset and you're not overriding any rules, you don't need to do anything.
no-fn-reference-in-iterator
→no-array-callback-reference
no-array-instanceof
→no-instanceof-array
no-reduce
→no-array-reduce
prefer-dataset
→prefer-dom-node-dataset
prefer-flat-map
→prefer-array-flat-map
prefer-replace-all
→prefer-string-replace-all
prefer-starts-ends-with
→prefer-string-starts-ends-with
prefer-text-content
→prefer-dom-node-text-content
prefer-trim-start-end
→prefer-string-trim-start-end
prefer-event-key
→prefer-keyboard-event-key
prefer-node-append
→prefer-dom-node-append
prefer-node-remove
→prefer-dom-node-remove
Improvements
explicit-length-check
: Make rule work in many more cases (#943) f3bc798explicit-length-check
: Check unsafeLogicalExpression
s (#952) a1b60adexplicit-length-check
: CheckBoolean(foo.length)
(#951) f4577f7explicit-length-check
: Check more cases (#941) 83a6453new-for-builtins
: IgnoreObject(x) === x
andObject(x) !== x
(#944) 5c7ea92explicit-length-check
: Rewrite rule (#938) 94ae87a
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