Releases: sindresorhus/eslint-plugin-unicorn
Releases Β· sindresorhus/eslint-plugin-unicorn
v44.0.0
New rules
Improvements
prefer-array-find: Add option to also prefer.findLast()(#1900) 02252c7template-indent: Preserve trailing spaces (#1872) e4071f5no-document-cookie: Checkwindow.document.cookie(#1833) 0886544prefer-array-index-of: Prefer.lastIndexOf()over.findLastIndex()(#1896) 70e5bddprefer-array-some: Check.findLast()(#1897) 3e6ae43prefer-native-coercion-functions: Check.findLastand.findLastIndex(#1893) f2c6accno-array-method-this-argument: Check.findLastand.findLastIndex(#1890) 3bc28adno-array-callback-reference: Check.findLastand.findLastIndex(#1889) 37a5cdaprefer-negative-index: RemoveArrayBuffer#at(#1899) a10e3f6prefer-at: Improve fix (#1901) 1c457bb
Fixes
v43.0.2
v43.0.1
- Remove
prefer-event-targetfrom the recommended preset 4d2faacEventTargetrequires Node.js 16 and we target Node.js 14. We'll enable it again in a year when we can target Node.js 16.
v43.0.0
New rules
Breaking
- Require Node.js 14
Improvements
- Add
prefer-top-level-awaitrule to recommended preset (#1803) 6f5ecf5 - Deprecate
import-indexrule (#1787) 0034e69 - Update abbreviations to support Next.js functions (#1804) 4b96057
text-encoding-identifier-case: Ignore JSXmeta[charset="utf-8"](#1817) c67a70fprefer-number-properties: Check any use of global functions (#1834) 51d7e06prefer-number-properties: Detect usage via global object (#1832) 80c4af2no-array-for-each: Check reassign infor..inandfor..of(#1824) d3b2548no-useless-undefined: Ignoreref(undefined)in Vue project (#1828) e7306e5prefer-node-protocol: Always checkrequire()(#1827) 2c914d4no-array-for-each: Improve parameter reassign detection (#1823) 56df468no-array-for-each: Add fix for arrow function body (#1785) 59218e3
Fixes
v42.0.0
The project has passed 100 lint rules π
Thanks to everyone that has contributed so far.
And special thanks to our team member @fisker for doing most of the work on this project. We could not have gotten this far without him.
New rules
no-useless-switch-case(#1779) a8fb966prefer-modern-math-apis(#1780) 6dfdeb0no-unreadable-iife(#1765) ce8a4b7prefer-native-coercion-functions(#1767) 51166f4
Improvements
template-indent: Set the ruleerrorinstead ofwarninrecommendedpreset (#1781) 09923afprefer-json-parse-buffer: Remove fromrecommendedpreset (#1750) 93f49f2no-array-for-each: Add fixer for parenthesized call (#1784) 5f39c37no-array-for-each: Handle optional chaining (#1753) 1d32db4prefer-object-from-entries: Stop checking unknown cases (#1771) 309771dprefer-string-trim-start-end: Check optional chaining (#1768) 1920597no-useless-undefined: Ignore arguments inFunction#bind()(#1762) c501243prefer-ternary: Skip fix if there are comments (#1763) 3013565text-encoding-identifier-case: Auto-fix encoding infs.{readFile,readFileSync}()(#1755) 5e1c932- Add
distanddstabbreviations (#1756) dffcea8
Fixes
v41.0.1
v41.0.0
v40.1.0
v40.0.0
New rules
no-thenable(#1616) c318644no-useless-promise-resolve-reject(#1623) 054436erelative-url-style(#1672) 6ab705bprefer-json-parse-buffer(#1676) 84c9c70
Improvements
prefer-object-has-own: Deprecate in favor of the built-inprefer-object-has-ownrule (#1646) e59a856filename-case: Ignore$in filenames (#1628) a43a174no-useless-promise-resolve-reject: Detect unnecessaryPromise.resolve/rejectin promise callback functions (#1666) f6215f3prefer-export-from: Support import assertions (#1618) 1d7a6b6prefer-top-level-await: Improve top-level expression detection (#1526) b054d65prefer-dom-node-dataset: Check.hasAttribute()and.getAttribute()(#1673) 152f153prefer-dom-node-dataset: Check.removeAttribute()(#1668) 22d8d03prefer-string-slice: Improve fix (#1675) 267115aprefer-math-trunc: Improve fix logic (#1670) 784c7a8prefer-string-slice: Improve argument type detection (#1664) 03b0946prefer-add-event-listener: Remove fix foronerror(#1650) 7bf63bbno-array-push-push: Ignoreprocess.{stdin,stdout,stderr}(#1654) 10ad699no-new-array&no-new-buffer: Improve argument type detection (#1648) 9b04e43no-array-for-each: IgnorepIteration.forEach(#1649) 2b92385no-array-callback-reference: Ignore primitive wrappers inArray#map()(#1642) 0362c09prefer-export-from: Support "string literal specifier" (#1636) 0866b41template-indent: Check Jest inline snapshots by default (#1637) 64460e2
Fixes
v39.0.0
New rules
Improvements
prefer-export-from: AddignoreUsedVariablesoption (#1590) a8d52e4prevent-abbreviations: Show file basename instead of full path (#1593) 7c2867d- Remove
require-post-message-target-originrule from recommended config (#1581) 014b4dc
Fixes
no-empty-file: Fix false positive with triple-slash directives (#1605) 6354bb8require-number-to-fixed-digits-argument: Ignore.toFixedfrom new expression (#1601) 20d61e7prefer-export-from: Fix bug on fixing export namespace as default (#1583) b564ff1- Add missing
additionalPropertiesto schema (#1589) 579d05d