Releases: sindresorhus/eslint-plugin-unicorn
Releases Β· sindresorhus/eslint-plugin-unicorn
v48.0.1
v48.0.0
Improvements
- Deprecate
no-unsafe-regexrule (#2135) 7b473aa prefer-top-level-await: Ignore promises insidePromise.{all,allSettled,any,race}()(#2139) d3f6b60no-process-exit: Ignore when usingnode:worker_threadsmodule (#2136) 2907805prefer-array-some: Ignore filter calls with literal argument (#2097) 7a32edbprefer-modern-math-api: Check cases thatMath.hypot()should be preferred (#2080) 9bbc948explicit-length-check: Ignore.length || number(#1977) b9b8794
Fixes
- Fix crash on array holes (#2129) f10f1a6
prefer-dom-node-dataset: Fix edge cases (#2171) b2d7378prefer-dom-node-dataset: Remove broken fix forelement.setAttribute(#2169) 61234afno-lonely-if: Fix an edge case (#2168) ca837a8no-useless-undefined: Turn parameter withundefineddefault value into optional parameter (#2138) 4aa7d60no-thenable: FixObject.fromEntries()check (#2130) f3265b9prefer-dom-node-remove: Fix incorrect auto-fix (#2084) 74bb36d
v47.0.0
Breaking
- Require Node.js 16 (#2073) a3bc120
- Require
eslint@>=8.38.0(#2066) 04af765 - Enable
prefer-at,prefer-event-target, andprefer-string-replace-allin recommended config (#2073) a3bc120
New rules
Improvements
prefer-top-level-await: Ignore.cjsfiles (#2072) 0c3ccb1prefer-spread: Stop checkingArray.fromcall with map function (#2064) f5beccbprefer-dom-node-text-content: Check optional chaining (#2062) 8d6d007prefer-dom-node-{append,remove}: Check optional chaining (#2061) 443999b
Fixes
v46.0.1
v46.0.0
Improvements
- Add
elemsto abbreviations (#2040) 2a9c840 no-useless-spread: CheckArray#{toReversed,toSorted,toSpliced,with}(#2030) 55469e5prefer-set-has: SupportArray#{toReversed,toSorted,toSpliced,with}(#2032) fea5b42prefer-spread: Forbid use ofArray#toSpliced()to copy array (#2034) 4ada50eprefer-negative-index: Check.toSpliced()and.with()(#2031) 7ed738ano-empty-file: Support.jsxand.tsxextensions (#2002) ba1a00e
Fixes
v45.0.2
v45.0.1
v45.0.0
New rules
no-typeof-undefined(#1966) d7f7341no-negated-condition(#1963) e4aaa42prefer-set-size(#1952) 5f23c98
Improvements
prefer-at: Support private fields (#1929) 60bb455no-useless-undefined: IgnoreArray#includes()andSet#has()(#1951) 8dfd5a7no-useless-spread: Check cloning inline arrays (#1980) 5d90d73prefer-top-level-await: Ignore expressions in class (#1976) b90a3aaprefer-string-replace-all: Improve RegExp to string fix (#1971) b844dbcprefer-string-replace-all: Check pattern even if it's already using.replaceAll(#1981) e8c5156prefer-string-replace-all: Report allString#replace()when the pattern hasgflag (#1965) 6316f05prefer-string-replace-all: Ignore regex with pipe (#1962) 76deaa3prefer-regexp-test: Use suggestions if not sure regexp withoutgflag (#1954) 505a203no-array-for-each: Skip fix for some edge cases (#1979) 48efc7aprefer-add-event-listener: Only fixExpressionStatement, checkoperator(#1955) aca21f2prevent-abbreviations: Improve fix forretVal(#1953) 25cd810