Skip to content

Releases: sindresorhus/eslint-plugin-unicorn

v30.0.0

19 Apr 13:16
Compare
Choose a tag to compare

New rules

Breaking

  • prevent-abbreviations: Rename options (#1164) cf42cc5
  • no-keyword-prefix: Rename blacklist option to disallowedPrefixes (#1180) 91e60d0

Improvements

Fixes

  • prefer-number-properties: Fix some edge cases (#1170) e7e25b8
  • prefer-number-properties: Fix some edge cases (part 2) (#1176) 3a58802
  • prefer-regexp-test: Do not fix if regexp has g flag (#1173) 8d97beb
  • no-array-for-each: Do not fix if callback parameter has type annotation (#1167) 0d4fc8b
  • no-useless-undefined: Do not report return undefined if function has returnType (#1165) 4ff39e0
  • prefer-set-has: Use suggestions if node has type annotation (#1158) 1221185
  • no-null: Exclude second argument of Node.insertBefore() (#1157) b16c316
  • prefer-add-event-listener: Fix crash on parenthesized cases (#1153) c95e854
  • Fix optional MemberExpression check when using ecmaVersion: 2019 (#1151) 56d5d9a
  • prefer-regexp-test: Do not fix if argument of String#match() is known not RegExp (#1152) 0abc394

v29.0.0...v30.0.0

v29.0.0

21 Mar 12:38
Compare
Choose a tag to compare

New rules

Improvements

  • no-array-for-each: Use let if parameters are reassigned (#1139) a13ad3c
  • no-array-push-push and prefer-ternary: Improve same reference detection (#1123) c2c28a6
  • prefer-spread: Add Array#slice() check (#1117) 8bdb52d

v28.0.2...v29.0.0

v28.0.2

18 Feb 05:11
Compare
Choose a tag to compare
  • prevent-abbreviations: Do not rename exported types when using @babel/eslint-parser (#1104) 9a91a3d
  • prevent-abbreviations: Do not rename exported TypeScript types (#1103) 5c08932

v28.0.1...v28.0.2

v28.0.1

15 Feb 10:57
Compare
Choose a tag to compare
  • Fix missing eslint-visitor-keys dependency (#1100) 5c1ff2e

v28.0.0...v28.0.1

v28.0.0

10 Feb 06:00
Compare
Choose a tag to compare

Improvements

Fixes

  • no-unreadable-array-destructuring: Fix crash on destructuring in for…of loop (#1076) 11ce1bc
  • no-array-for-each: Ignore React.Children.forEach (#1088) 5a931dd
  • prefer-string-slice: Keep optional chaining in autofix (#1085) acaf197
  • prefer-spread: Ignore Buffer.concat() (#1069) da685f7
  • Ignore unexpected case in catch-error-name and prefer-set-has (#1077) 79a64b1
  • prefer-default-parameters: Fix non-iterable visitorKeys (#1013) d707e83
  • consistent-destructuring: Add ExperimentalRestProperty check (#1060) aca2ec5

v27.0.0...v28.0.0

v27.0.0

22 Jan 19:00
Compare
Choose a tag to compare

New rules

Improvements

Fixes

  • prefer-query-selector: Fix crash on unexpected selector (#1034) 88018ca

v26.0.1...v27.0.0

v26.0.1

13 Jan 11:16
Compare
Choose a tag to compare
  • prefer-math-trunc: Use suggestion instead of auto-fix for x | 0 (#1014) 74b1b2d

v26.0.0...v26.0.1

v26.0.0

11 Jan 11:20
Compare
Choose a tag to compare

New rules

Improvements

  • Remove import-index rule from recommended preset (#977) ff1cd2e
  • prefer-string-starts-ends-with: Remove check on String#match() (#1002) c9fa8b1
  • no-array-callback-reference: Ignore AwaitExpression except reduce and reduceRight (#814) 4c2b00b

Fixes

  • prefer-string-starts-ends-with: Fix missing parentheses for some cases (#976) e2f94fe
  • Don't consider ?? operator LogicExpression as a boolean value node (#986) dc7f79b

v25.0.0...v26.0.0

v25.0.1

30 Dec 06:42
Compare
Choose a tag to compare

v25.0.0

28 Dec 17:57
Compare
Choose a tag to compare

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-iteratorno-array-callback-reference
  • no-array-instanceofno-instanceof-array
  • no-reduceno-array-reduce
  • prefer-datasetprefer-dom-node-dataset
  • prefer-flat-mapprefer-array-flat-map
  • prefer-replace-allprefer-string-replace-all
  • prefer-starts-ends-withprefer-string-starts-ends-with
  • prefer-text-contentprefer-dom-node-text-content
  • prefer-trim-start-endprefer-string-trim-start-end
  • prefer-event-keyprefer-keyboard-event-key
  • prefer-node-appendprefer-dom-node-append
  • prefer-node-removeprefer-dom-node-remove

20c6341

Improvements

  • explicit-length-check: Make rule work in many more cases (#943) f3bc798
  • explicit-length-check: Check unsafe LogicalExpressions (#952) a1b60ad
  • explicit-length-check: Check Boolean(foo.length) (#951) f4577f7
  • explicit-length-check: Check more cases (#941) 83a6453
  • new-for-builtins: Ignore Object(x) === x and Object(x) !== x (#944) 5c7ea92
  • explicit-length-check: Rewrite rule (#938) 94ae87a

v24.0.0...v25.0.0