Releases: sindresorhus/eslint-plugin-unicorn
Releases · sindresorhus/eslint-plugin-unicorn
v30.0.0
New rules
Breaking
prevent-abbreviations
: Rename options (#1164) cf42cc5no-keyword-prefix
: Renameblacklist
option todisallowedPrefixes
(#1180) 91e60d0
Improvements
no-array-push-push
: Addignore
option (#1168) f9262d9prefer-spread
: Reportarray.slice(0)
(#1182) 92bebe1no-useless-undefined
: Handle parenthesizedundefined
(#1178) c88882eno-array-for-each
: Improve fixable parameter detection (#1177) 18d1ac2prefer-array-flat-map
: ExcludeReact.Children.map().flat()
(#1159) 3e6b6fbbetter-regex
: Report parsing errors (#1133) 51ee030filename-case
: Uniquify suggestion filenames (#1160) a87238f- Support
PropertyDefinition
(#1127) 75c4d78
Fixes
prefer-number-properties
: Fix some edge cases (#1170) e7e25b8prefer-number-properties
: Fix some edge cases (part 2) (#1176) 3a58802prefer-regexp-test
: Do not fix if regexp hasg
flag (#1173) 8d97bebno-array-for-each
: Do not fix if callback parameter has type annotation (#1167) 0d4fc8bno-useless-undefined
: Do not reportreturn undefined
if function hasreturnType
(#1165) 4ff39e0prefer-set-has
: Use suggestions if node has type annotation (#1158) 1221185no-null
: Exclude second argument ofNode.insertBefore()
(#1157) b16c316prefer-add-event-listener
: Fix crash on parenthesized cases (#1153) c95e854- Fix optional
MemberExpression
check when usingecmaVersion: 2019
(#1151) 56d5d9a prefer-regexp-test
: Do not fix if argument ofString#match()
is known notRegExp
(#1152) 0abc394
v29.0.0
v28.0.2
v28.0.1
v28.0.0
Improvements
no-lonely-if
: Keep all comments (#1047) da94ca9prefer-includes
: AddArray#some()
check (#1097) ee3a2e5prefer-includes
: Improve report location (#1061) 83575a8prefer-spread
: Improve auto-fix (#1080) e54dc66prefer-spread
: Add more suggestions for.concat
fix (#1054) 673c440
Fixes
no-unreadable-array-destructuring
: Fix crash on destructuring infor…of
loop (#1076) 11ce1bcno-array-for-each
: IgnoreReact.Children.forEach
(#1088) 5a931ddprefer-string-slice
: Keep optional chaining in autofix (#1085) acaf197prefer-spread
: IgnoreBuffer.concat()
(#1069) da685f7- Ignore unexpected case in
catch-error-name
andprefer-set-has
(#1077) 79a64b1 prefer-default-parameters
: Fix non-iterablevisitorKeys
(#1013) d707e83consistent-destructuring
: AddExperimentalRestProperty
check (#1060) aca2ec5
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