Releases: sindresorhus/eslint-plugin-unicorn
Releases · sindresorhus/eslint-plugin-unicorn
v33.0.1
v33.0.0
New rules
require-array-join-separator
(#1284) 36e7103require-number-to-fixed-digits-argument
(#1288) 4a30863prefer-prototype-methods
(#1247) 7bde733prefer-object-has-own
(#1322) ca34b40- Not enabled in the
recommended
preset.
- Not enabled in the
Improvements
no-array-for-each
: Handle only return statement insideif
orelse
(#1319) 298a104new-for-builtins
&no-new-buffer
: Handle line breaks afternew
keyword (#1301) d37439fprefer-array-flat-map
: Remove check on[].concat(...array.map(…))
(#1299) 128b5aaprefer-spread
: Ignore{arrayBuffer,blob,buffer,file,this}.slice()
(#1287) e18d5f2prefer-string-starts-ends-with
: Add suggestions for safely handling non-strings (#1277) f14a9d1explicit-length-check
: Ignorethis.{size,length}
(#1289) ed85d00prefer-string-starts-ends-with-rule
: Don't autofix known non-string values (#1281) a1c8984explicit-length-check
: Ignore known, non-number length properties (#1264) 42f6487empty-brace-spaces
: Support experimental syntax (#1276) fa68b6fprefer-dom-node-remove
: Improve parentheses handling (#1254) 74e4d39
Fixes
v32.0.1
v32.0.0
Breaking
- Drop support for Node.js v10 (#1211) a8e9f26
- Drop support for
babel-eslint
(#1211) a8e9f26
You should migrate to@babel/eslint-parser
New rules
no-document-cookie
(#1244) 866c4a3numeric-separators-style
- Was previously disabled.prefer-array-flat
- Was previously disabled.prefer-array-flat-map
- Was previously disabled.
Improvements
no-for-loop
: Ignore known non-array loop variables (#1242) 29f6b45prefer-array-find
: Singularize variable name in autofix (#1243) 6b340a3prefer-switch
: Do not add braces to the default case (#1235) c241782no-zero-fractions
: Handle numeric separators, fix missing parentheses, improve report location (#1238) 2724afano-array-for-each
: Better error message (#1239) 2e82dc8prefer-switch
: Avoid conflict withno-unreachable
rule (#1234) 1c78d0cprefer-optional-catch-binding
: Support checking destructured errors (#1229) a0b2f4fno-array-for-each
: Support autofixing complicated parameters (#1228) d84143fprefer-negative-index
: SupportArray#at()
(#1217) 6443ee3explicit-length-check
: CheckSet#size
(#1226) 6a745a0filename-case
: Improve report position (#1227) 3d4ac1b
Fixes
v31.0.0
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