Skip to content

Releases: sindresorhus/eslint-plugin-unicorn

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

v19.0.0

25 Apr 15:15
Compare
Choose a tag to compare

New rules

Breaking

  • string-content: Make it have no default patterns (#637) 08fad55
  • catch-error-name: Replace caughtErrorsIgnorePattern option with an ignore option (#661) 5a27f04

Improvements

  • custom-error-definition: Support class properties (#673) 9cc8d60
  • catch-error-name: Support Promise#then (#660) edcf73c
  • prefer-set-has: Supports more types of array (#641) 29f3c9c

Fixes

  • escape-case: Fix missing characters (#678) d986427
  • no-nested-ternary: Fix incorrect result with TypeScript parser (#664) cb08ed0
  • custom-error-definition: Fix duplicated reports on this.message assign (#669) aa00647
  • custom-error-definition: Fix crash on @typescript-eslint/parser (#659) e8cb921
  • catch-error-name: Improve error message (#665) 8ac9a90
  • catch-error-name: Fix error renaming (#654) cc2d1b1
  • catch-error-name: Only allow _ when it's not used (#650) 0c31a0b
  • catch-error-name: Ignore destructuring (#649) b2838fd

v18.0.1...v19.0.0

v18.0.1

27 Mar 07:21
Compare
Choose a tag to compare
  • prefer-number-properties: Fix suggestion description (#635) d410ca3

v18.0.0...v18.0.1

v18.0.0

26 Mar 12:51
Compare
Choose a tag to compare

New rules

Improvements

Fixes

  • no-console-spaces: Fix crash on string contains \n (#629) 9cd01cd
  • explicit-length-check: Ignore computed length of MemberExpression (#620) 418e072
  • prefer-spread: Insert semicolon in more cases (#615) de48b3d
  • catch-error-name: Keep typeAnnotation when replacing identifier (#613) 446ff37
  • prevent-abbreviations: Fix crash on TypeParameter with default value (#606) 2ef7a21
  • prevent-abbreviations: Add global variables check (#603) b5c0a12
  • Update regexp-tree to fix whitespace rewrite (#605) 2b78a17

v17.2.0...v18.0.0