Releases: sindresorhus/eslint-plugin-unicorn
Releases · sindresorhus/eslint-plugin-unicorn
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-unreachablerule (#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: Renameblacklistoption todisallowedPrefixes(#1180) 91e60d0
Improvements
no-array-push-push: Addignoreoption (#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 hasgflag (#1173) 8d97bebno-array-for-each: Do not fix if callback parameter has type annotation (#1167) 0d4fc8bno-useless-undefined: Do not reportreturn undefinedif 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
MemberExpressioncheck 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.concatfix (#1054) 673c440
Fixes
no-unreadable-array-destructuring: Fix crash on destructuring infor…ofloop (#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-nameandprefer-set-has(#1077) 79a64b1 prefer-default-parameters: Fix non-iterablevisitorKeys(#1013) d707e83consistent-destructuring: AddExperimentalRestPropertycheck (#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-lineoption (#1025) 306c9e7numeric-separators-style: AddonlyIfContainsSeparatoroption (#916) 8d32574prefer-spread: Prefer...overArray#concat()(#1029) cda72bdprefer-spread: Fix more.concatcases (#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