Skip to content

Releases: sindresorhus/eslint-plugin-unicorn

v49.0.0

29 Oct 19:53
Compare
Choose a tag to compare

Improvements

  • expiring-todo-comments: Support monorepos (#2159) ac51d40
  • prefer-module: Allow module as TSIndexSignature names or TSTypeAliasDeclaration ids (#2209) ea94b3b
  • Support RegExp v flag (#2195) 28e7498
  • prefer-event-target: Ignore EventEmitter from @angular/core and eventemitter3 (#2197) 1629ebe

v48.0.1...v49.0.0

v48.0.1

25 Jul 16:06
Compare
Choose a tag to compare
  • no-empty-file: Fix directive check for TypeScript parser (#2180) 1bb9ce8

v48.0.0...v48.0.1

v48.0.0

15 Jul 12:11
Compare
Choose a tag to compare

Improvements

  • Deprecate no-unsafe-regex rule (#2135) 7b473aa
  • prefer-top-level-await: Ignore promises inside Promise.{all,allSettled,any,race}() (#2139) d3f6b60
  • no-process-exit: Ignore when using node:worker_threads module (#2136) 2907805
  • prefer-array-some: Ignore filter calls with literal argument (#2097) 7a32edb
  • prefer-modern-math-api: Check cases that Math.hypot() should be preferred (#2080) 9bbc948
  • explicit-length-check: Ignore .length || number (#1977) b9b8794

Fixes

  • Fix crash on array holes (#2129) f10f1a6
  • prefer-dom-node-dataset: Fix edge cases (#2171) b2d7378
  • prefer-dom-node-dataset: Remove broken fix for element.setAttribute (#2169) 61234af
  • no-lonely-if: Fix an edge case (#2168) ca837a8
  • no-useless-undefined: Turn parameter with undefined default value into optional parameter (#2138) 4aa7d60
  • no-thenable: Fix Object.fromEntries() check (#2130) f3265b9
  • prefer-dom-node-remove: Fix incorrect auto-fix (#2084) 74bb36d

v47.0.0...v48.0.0

v47.0.0

06 May 07:48
Compare
Choose a tag to compare

Breaking

  • Require Node.js 16 (#2073) a3bc120
  • Require eslint@>=8.38.0 (#2066) 04af765
  • Enable prefer-at, prefer-event-target, and prefer-string-replace-all in recommended config (#2073) a3bc120

New rules

Improvements

  • prefer-top-level-await: Ignore .cjs files (#2072) 0c3ccb1
  • prefer-spread: Stop checking Array.from call with map function (#2064) f5beccb
  • prefer-dom-node-text-content: Check optional chaining (#2062) 8d6d007
  • prefer-dom-node-{append,remove}: Check optional chaining (#2061) 443999b

Fixes

  • prefer-number-properties: Fix false positives (#2050) 124bfa7

v46.0.0...v47.0.0

v46.0.1

06 May 07:35
Compare
Choose a tag to compare

v46.0.0...v46.0.1

v46.0.0

03 Mar 15:29
Compare
Choose a tag to compare

Improvements

  • Add elems to abbreviations (#2040) 2a9c840
  • no-useless-spread: Check Array#{toReversed,toSorted,toSpliced,with} (#2030) 55469e5
  • prefer-set-has: Support Array#{toReversed,toSorted,toSpliced,with} (#2032) fea5b42
  • prefer-spread: Forbid use of Array#toSpliced() to copy array (#2034) 4ada50e
  • prefer-negative-index: Check .toSpliced() and .with() (#2031) 7ed738a
  • no-empty-file: Support .jsx and .tsx extensions (#2002) ba1a00e

Fixes

v45.0.2...v46.0.0

v45.0.2

12 Dec 11:57
Compare
Choose a tag to compare
  • prefer-string-replace-all: Don't crash on invalid pattern (#2011) 3bbe027
  • prevent-abbreviations: Skip fix for variables used in Vue template (#2012) 8cd1ded

v45.0.1...v45.0.2

v45.0.1

28 Nov 09:47
Compare
Choose a tag to compare

v45.0.0...v45.0.1

v45.0.0

20 Nov 18:25
Compare
Choose a tag to compare

New rules

Improvements

  • prefer-at: Support private fields (#1929) 60bb455
  • no-useless-undefined: Ignore Array#includes() and Set#has() (#1951) 8dfd5a7
  • no-useless-spread: Check cloning inline arrays (#1980) 5d90d73
  • prefer-top-level-await: Ignore expressions in class (#1976) b90a3aa
  • prefer-string-replace-all: Improve RegExp to string fix (#1971) b844dbc
  • prefer-string-replace-all: Check pattern even if it's already using .replaceAll (#1981) e8c5156
  • prefer-string-replace-all: Report all String#replace() when the pattern has g flag (#1965) 6316f05
  • prefer-string-replace-all: Ignore regex with pipe (#1962) 76deaa3
  • prefer-regexp-test: Use suggestions if not sure regexp without g flag (#1954) 505a203
  • no-array-for-each: Skip fix for some edge cases (#1979) 48efc7a
  • prefer-add-event-listener: Only fix ExpressionStatement, check operator (#1955) aca21f2
  • prevent-abbreviations: Improve fix for retVal (#1953) 25cd810

Fixes

  • prefer-top-level-await: Fix crash on for..of loop (#1950) 00a29c8

v44.0.2...v45.0.0

v44.0.2

07 Oct 05:17
Compare
Choose a tag to compare
  • no-array-method-this-argument: Ignore lodash.findLast and lodash.findLastIndex (#1927) 86e8add

v44.0.1...v44.0.2