Skip to content

Releases: sindresorhus/eslint-plugin-unicorn

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

v24.0.0

17 Dec 10:30
Compare
Choose a tag to compare

New rules

Improvements

  • prevent-abbreviations: Add ignore option (#891) 898fcb4
  • no-useless-undefined: Add checkArguments option (#877) a1617b9
  • consistent-function-scoping: Allow ignoring arrow functions (#932) 17bf27c
  • Rewrite error-message rule (#922) 877bef9
  • Improve prefer-query-selector rule (#908) 635601d
  • prevent-abbreviations: Add var/vars replacements (#894) 07dadf5
  • prevent-abbreviations: Add verversion replacement (#870) e755cdd
  • prefer-number-properties: Support computed key of ClassProperty MethodDefinition Property (#886) 769ac35
  • prefer-optional-catch-binding: Improve output (#884) 375d11a
  • no-null: Exclude useRef(null) and React.useRef(null) (#890) 7a4dbf4
  • prefer-number-properties: Add Infinity support (#874) 643169b
  • no-console-spaces: Improve report location (#866) 190cbac
  • no-useless-undefined: Ignore toHaveBeenCalledWith method (#876) d10a641
  • prefer-replace-all: Handle u flag (#879) d98d867
  • no-for-loop: Improve output when using the TypeScript parser (#883) 52edd3b
  • no-for-loop: Respect declaration kind (#878) df3f7bd
  • no-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 on babel-eslint parser (#927) 9f5f721
  • prevent-abbreviations: Fix crash with TypeScript parser (#913) 9d5eca6
  • prefer-query-selector: Fix crash on calling without argument (#906) 36908da
  • import-style: Fix crash on destructing require (#904) 8335d41
  • new-for-builtins: Remove auto-fix for new String, new Boolean(), and new Number() (#907) dfc1ce0

v23.0.0...v24.0.0

v23.0.0

16 Oct 22:04
Compare
Choose a tag to compare

New rules

Improvements

  • explicit-length-check: Use 'non-zero': 'greater-than' by default (#850) 7c5df5f
  • prevent-abbreviations: Add fn/func -> function, i/idx/j -> index replacements (#836) e502f42
  • consistent-function-scoping: Check anonymous functions (#835) 29ecbf6
  • no-console-spaces: Make space position more specific (#838) e17a63f
  • no-nested-ternary: Improve report location & message (#844) ca1afa6
  • Track JSX presence per-function, fixing some false negatives (#830) 85d424c

Fixes

  • prefer-flat-map: Exclude .flat() where depth is not 1 (#859) 61d9851

v22.0.0...v23.0.0

v22.0.0

18 Sep 21:41
Compare
Choose a tag to compare

New rules

Improvements

Fixes

  • prefer-trim-start-end: Fix error message, improve report location (#823) b35c261
  • number-literal-case: Fix false positive on @typescript-eslint/parser (#815) 33a1268
  • no-unused-properties: Fix error thrown when using rest in object destructuring (#811) 1475f39

v21.0.0...v22.0.0

v21.0.0

17 Jul 17:04
Compare
Choose a tag to compare

New rules

Improvements

  • Add ev to event default replacement to prevent-abbreviations rule (#793) a0b4aba
  • Ignore more types in no-fn-reference-in-iterator and no-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

Fixes

  • consistent-function-scoping: Fix wrong detect of IIFE (#772) f7127da
  • prefer-starts-ends-with: Fix pipe in regex (#783) 1dca2f3
  • prevent-abbreviations: Fix optional parameter (#764) 7781c3f
  • no-useless-undefined: Ignore undefined use in compare functions (#758) 6d36407

v20.1.0...v21.0.0

v20.1.0

27 May 05:10
Compare
Choose a tag to compare
  • Use singular array element variable name in autofix for no-for-loop rule (#745) 2002093
  • Avoid naming collision with default array element variable in autofix for no-for-loop rule (#749) 48bd5c8

v20.0.0...v20.1.0

v20.0.0

13 May 07:06
Compare
Choose a tag to compare

Breaking

New rules

Improvements

  • throw-new-error: Check MemberExpression customError (#716) a28aad5
  • prefer-starts-ends-with: Add auto-fix (#711) da978e3
  • consistent-function-scoping: Ignore IIFE (#707) 1f4413d
  • prefer-set-has: Ignore arrays only checking existence once (#706) 54c6f54

Fixes

  • prefer-starts-ends-with: Fix bug with m flag (#721) 83bbabc
  • prefer-string-slice: Handle negative length in .substr() (#709) 7439465

v19.0.1...v20.0.0

v19.0.1

26 Apr 03:28
Compare
Choose a tag to compare
  • no-fn-reference-in-iterator: Ignore this. and Vue.filter (#699) b02a9c6
  • no-fn-reference-in-iterator: Ignore cases obviously not a function reference (#697) dae5107

v19.0.0...v19.0.1