Skip to content

Releases: sindresorhus/eslint-plugin-unicorn

v44.0.1

05 Oct 05:32
Compare
Choose a tag to compare
  • prefer-array-index-of: Add missing message (#1924) a981a13

v44.0.0...v44.0.1

v44.0.0

01 Oct 07:13
Compare
Choose a tag to compare

New rules

Improvements

  • prefer-array-find: Add option to also prefer .findLast() (#1900) 02252c7
  • template-indent: Preserve trailing spaces (#1872) e4071f5
  • no-document-cookie: Check window.document.cookie (#1833) 0886544
  • prefer-array-index-of: Prefer .lastIndexOf() over .findLastIndex() (#1896) 70e5bdd
  • prefer-array-some: Check .findLast() (#1897) 3e6ae43
  • prefer-native-coercion-functions: Check .findLast and .findLastIndex (#1893) f2c6acc
  • no-array-method-this-argument: Check .findLast and .findLastIndex (#1890) 3bc28ad
  • no-array-callback-reference: Check .findLast and .findLastIndex (#1889) 37a5cda
  • prefer-negative-index: Remove ArrayBuffer#at (#1899) a10e3f6
  • prefer-at: Improve fix (#1901) 1c457bb

Fixes

  • no-await-expression-member: Fix crash on TypeScript parser (#1910) b002e75
  • prevent-abbreviations: Skip fix when variable is JSX component (#1907) 9ed08ab
  • better-regexp: Don't fix if .source or .toString() is used (#1903) 8ad592b

v43.0.2...v44.0.0

v43.0.2

18 Jul 12:34
Compare
Choose a tag to compare
  • prefer-spread: Ignore Array#join().concat() and (a + b).concat() (#1859) ab71971

v43.0.1...v43.0.2

v43.0.1

07 Jul 21:45
Compare
Choose a tag to compare
  • Remove prefer-event-target from the recommended preset 4d2faac
    • EventTarget requires 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...v43.0.1

v43.0.0

30 Jun 16:44
Compare
Choose a tag to compare

New rules

Breaking

  • Require Node.js 14

Improvements

  • Add prefer-top-level-await rule to recommended preset (#1803) 6f5ecf5
  • Deprecate import-index rule (#1787) 0034e69
  • Update abbreviations to support Next.js functions (#1804) 4b96057
  • text-encoding-identifier-case: Ignore JSX meta[charset="utf-8"] (#1817) c67a70f
  • prefer-number-properties: Check any use of global functions (#1834) 51d7e06
  • prefer-number-properties: Detect usage via global object (#1832) 80c4af2
  • no-array-for-each: Check reassign in for..in and for..of (#1824) d3b2548
  • no-useless-undefined: Ignore ref(undefined) in Vue project (#1828) e7306e5
  • prefer-node-protocol: Always check require() (#1827) 2c914d4
  • no-array-for-each: Improve parameter reassign detection (#1823) 56df468
  • no-array-for-each: Add fix for arrow function body (#1785) 59218e3

Fixes

  • no-array-for-each: Fix auto-fix causing SyntaxError (#1813) 47c8337

v42.0.0...v43.0.0

v42.0.0

01 Apr 14:39
Compare
Choose a tag to compare

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

Improvements

  • template-indent: Set the rule error instead of warn in recommended preset (#1781) 09923af
  • prefer-json-parse-buffer: Remove from recommended preset (#1750) 93f49f2
  • no-array-for-each: Add fixer for parenthesized call (#1784) 5f39c37
  • no-array-for-each: Handle optional chaining (#1753) 1d32db4
  • prefer-object-from-entries: Stop checking unknown cases (#1771) 309771d
  • prefer-string-trim-start-end: Check optional chaining (#1768) 1920597
  • no-useless-undefined: Ignore arguments in Function#bind() (#1762) c501243
  • prefer-ternary: Skip fix if there are comments (#1763) 3013565
  • text-encoding-identifier-case: Auto-fix encoding in fs.{readFile,readFileSync}() (#1755) 5e1c932
  • Add dist and dst abbreviations (#1756) dffcea8

Fixes

  • no-array-for-each: Handle ChainExpression correctly (#1772) e615a37

v41.0.1...v42.0.0

v41.0.1

17 Mar 09:41
Compare
Choose a tag to compare

v41.0.0...v41.0.1

v41.0.0

16 Feb 16:20
Compare
Choose a tag to compare

New rules

Breaking

Fixes

  • prefer-export-from: Fix TypeScript compatibility (#1728) f14aa95
  • prefer-at: Remove auto-fix for arguments (#1705) bba518e

v40.1.0...v41.0.0

v40.1.0

16 Jan 06:54
Compare
Choose a tag to compare
  • expiring-todo-comments: Add date option (#1683) 16bc33a
  • consistent-function-scoping: Allow React.useHook (#1691) e910633
  • no-useless-undefined: Allow React.createContext(undefined) (#1688) 40bc603

v40.0.0...v40.1.0

v40.0.0

31 Dec 12:52
Compare
Choose a tag to compare

New rules

Improvements

  • prefer-object-has-own: Deprecate in favor of the built-in prefer-object-has-own rule (#1646) e59a856
  • filename-case: Ignore $ in filenames (#1628) a43a174
  • no-useless-promise-resolve-reject: Detect unnecessary Promise.resolve/reject in promise callback functions (#1666) f6215f3
  • prefer-export-from: Support import assertions (#1618) 1d7a6b6
  • prefer-top-level-await: Improve top-level expression detection (#1526) b054d65
  • prefer-dom-node-dataset: Check .hasAttribute() and .getAttribute() (#1673) 152f153
  • prefer-dom-node-dataset: Check .removeAttribute() (#1668) 22d8d03
  • prefer-string-slice: Improve fix (#1675) 267115a
  • prefer-math-trunc: Improve fix logic (#1670) 784c7a8
  • prefer-string-slice: Improve argument type detection (#1664) 03b0946
  • prefer-add-event-listener: Remove fix for onerror (#1650) 7bf63bb
  • no-array-push-push: Ignore process.{stdin,stdout,stderr} (#1654) 10ad699
  • no-new-array & no-new-buffer: Improve argument type detection (#1648) 9b04e43
  • no-array-for-each: Ignore pIteration.forEach (#1649) 2b92385
  • no-array-callback-reference: Ignore primitive wrappers in Array#map() (#1642) 0362c09
  • prefer-export-from: Support "string literal specifier" (#1636) 0866b41
  • template-indent: Check Jest inline snapshots by default (#1637) 64460e2

Fixes

  • prefer-dom-node-dataset: Fix name conversion (#1674) 7fb6f7b
  • prefer-export-from: Fix crash in TypeScript files (#1647) 1ff8e42

v39.0.0...v40.0.0