More than 100 powerful ESLint rules
MIT License
Bot releases are hidden (Show)
no-single-promise-in-promise-methods
(#2258) 8f0ee89no-await-in-promise-methods
(#2259) a3be554no-anonymous-default-export
(#2273) c035216filename-case
: Add option for multiple file extensions (#2186) 4594020import-style
: Support node:
protocol (#2297) c28a086prefer-array-find
: Check array.filter().at(0)
(#2284) e6074feprefer-prototype-methods
: Check Object.prototype
methods from globalThis
(#2286) 1792d33no-array-callback-reference
: Check logical expressions and check ternaries deeply (#2289) 231529aprefer-spread
: Fix it to not report on optional chaining (#2304) df1ff1cno-anonymous-default-export
: Uppercase class name (#2282) 5ce4169https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v51.0.1...v52.0.0
prefer-node-protocol
: Fix false positive on bun:*
modules (#2272) 43fc638https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v51.0.0...v51.0.1
consistent-destructuring
: Remove from recommended
preset (#2260) 702d51bno-array-method-this-argument
: Check Array.from()
(#2262) 797caeeno-thenable
: Fix crash on {[Symbol.prototype]: 0}
(#2248) 3c7d7c0prefer-prototype-methods
: Fix argument of isMethodCall
(#2247) 3b504fahttps://github.com/sindresorhus/eslint-plugin-unicorn/compare/v50.0.1...v51.0.0
no-unnecessary-polyfills
: Fix missing dependency error (#2242) 3df16068https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v50.0.0...v50.0.1
no-unnecessary-polyfills
(#1717) 6788d86no-useless-undefined
: Add checkArrowFunctionBody
option (#2232) 9d7048cprefer-negative-index
: Check TypedArray#subarray()
(#2237) 6708a30no-useless-undefined
: Ignore React state setters (#2223) 42881baprefer-module
: Allow module
as TSTypeParameter name (#2213) 8f61f7cstring-content
: Fix JSX autofix for newlines, etc. (#2222) b95e75ehttps://github.com/sindresorhus/eslint-plugin-unicorn/compare/v49.0.0...v50.0.0
expiring-todo-comments
: Support monorepos (#2159) ac51d40prefer-module
: Allow module
as TSIndexSignature names or TSTypeAliasDeclaration ids (#2209) ea94b3bv
flag (#2195) 28e7498prefer-event-target
: Ignore EventEmitter
from @angular/core
and eventemitter3
(#2197) 1629ebehttps://github.com/sindresorhus/eslint-plugin-unicorn/compare/v48.0.1...v49.0.0
no-empty-file
: Fix directive check for TypeScript parser (#2180) 1bb9ce8https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v48.0.0...v48.0.1
no-unsafe-regex
rule (#2135) 7b473aaprefer-top-level-await
: Ignore promises inside Promise.{all,allSettled,any,race}()
(#2139) d3f6b60no-process-exit
: Ignore when using node:worker_threads
module (#2136) 2907805prefer-array-some
: Ignore filter calls with literal argument (#2097) 7a32edbprefer-modern-math-api
: Check cases that Math.hypot()
should be preferred (#2080) 9bbc948explicit-length-check
: Ignore .length || number
(#1977) b9b8794prefer-dom-node-dataset
: Fix edge cases (#2171) b2d7378prefer-dom-node-dataset
: Remove broken fix for element.setAttribute
(#2169) 61234afno-lonely-if
: Fix an edge case (#2168) ca837a8no-useless-undefined
: Turn parameter with undefined
default value into optional parameter (#2138) 4aa7d60no-thenable
: Fix Object.fromEntries()
check (#2130) f3265b9prefer-dom-node-remove
: Fix incorrect auto-fix (#2084) 74bb36dhttps://github.com/sindresorhus/eslint-plugin-unicorn/compare/v47.0.0...v48.0.0
eslint@>=8.38.0
(#2066) 04af765prefer-at
, prefer-event-target
, and prefer-string-replace-all
in recommended config (#2073) a3bc120prefer-blob-reading-methods
(#2065) 2bb1a04prefer-top-level-await
: Ignore .cjs
files (#2072) 0c3ccb1prefer-spread
: Stop checking Array.from
call with map function (#2064) f5beccbprefer-dom-node-text-content
: Check optional chaining (#2062) 8d6d007prefer-dom-node-{append,remove}
: Check optional chaining (#2061) 443999bprefer-number-properties
: Fix false positives (#2050) 124bfa7https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v46.0.0...v47.0.0
expiring-todo-comments
(#2077) 7a6861ahttps://github.com/sindresorhus/eslint-plugin-unicorn/compare/v46.0.0...v46.0.1
elems
to abbreviations (#2040) 2a9c840no-useless-spread
: Check Array#{toReversed,toSorted,toSpliced,with}
(#2030) 55469e5prefer-set-has
: Support Array#{toReversed,toSorted,toSpliced,with}
(#2032) fea5b42prefer-spread
: Forbid use of Array#toSpliced()
to copy array (#2034) 4ada50eprefer-negative-index
: Check .toSpliced()
and .with()
(#2031) 7ed738ano-empty-file
: Support .jsx
and .tsx
extensions (#2002) ba1a00eexpiring-todo-comments
: Do not normalize package.json (#1871) (#2020) fcd8934https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v45.0.2...v46.0.0
prefer-string-replace-all
: Don't crash on invalid pattern (#2011) 3bbe027prevent-abbreviations
: Skip fix for variables used in Vue template (#2012) 8cd1dedhttps://github.com/sindresorhus/eslint-plugin-unicorn/compare/v45.0.1...v45.0.2
no-useless-spread
: Remove unsafe fix (#1996) 6756cbdhttps://github.com/sindresorhus/eslint-plugin-unicorn/compare/v45.0.0...v45.0.1
no-typeof-undefined
(#1966) d7f7341no-negated-condition
(#1963) e4aaa42prefer-set-size
(#1952) 5f23c98prefer-at
: Support private fields (#1929) 60bb455no-useless-undefined
: Ignore Array#includes()
and Set#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 all String#replace()
when the pattern has g
flag (#1965) 6316f05prefer-string-replace-all
: Ignore regex with pipe (#1962) 76deaa3prefer-regexp-test
: Use suggestions if not sure regexp without g
flag (#1954) 505a203no-array-for-each
: Skip fix for some edge cases (#1979) 48efc7aprefer-add-event-listener
: Only fix ExpressionStatement
, check operator
(#1955) aca21f2prevent-abbreviations
: Improve fix for retVal
(#1953) 25cd810prefer-top-level-await
: Fix crash on for..of
loop (#1950) 00a29c8https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v44.0.2...v45.0.0
no-array-method-this-argument
: Ignore lodash.findLast
and lodash.findLastIndex
(#1927) 86e8addhttps://github.com/sindresorhus/eslint-plugin-unicorn/compare/v44.0.1...v44.0.2
prefer-array-index-of
: Add missing message (#1924) a981a13https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v44.0.0...v44.0.1
no-unnecessary-await
(#1904) 412fc6fswitch-case-braces
(#1902) 690ed8cprefer-array-find
: Add option to also prefer .findLast()
(#1900) 02252c7template-indent
: Preserve trailing spaces (#1872) e4071f5no-document-cookie
: Check window.document.cookie
(#1833) 0886544prefer-array-index-of
: Prefer .lastIndexOf()
over .findLastIndex()
(#1896) 70e5bddprefer-array-some
: Check .findLast()
(#1897) 3e6ae43prefer-native-coercion-functions
: Check .findLast
and .findLastIndex
(#1893) f2c6accno-array-method-this-argument
: Check .findLast
and .findLastIndex
(#1890) 3bc28adno-array-callback-reference
: Check .findLast
and .findLastIndex
(#1889) 37a5cdaprefer-negative-index
: Remove ArrayBuffer#at
(#1899) a10e3f6prefer-at
: Improve fix (#1901) 1c457bbno-await-expression-member
: Fix crash on TypeScript parser (#1910) b002e75prevent-abbreviations
: Skip fix when variable is JSX component (#1907) 9ed08abbetter-regexp
: Don't fix if .source
or .toString()
is used (#1903) 8ad592bhttps://github.com/sindresorhus/eslint-plugin-unicorn/compare/v43.0.2...v44.0.0
prefer-spread
: Ignore Array#join().concat()
and (a + b).concat()
(#1859) ab71971https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v43.0.1...v43.0.2
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.https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v43.0.0...v43.0.1
prefer-logical-operator-over-ternary
(#1830) 5d7e622prefer-event-target
(#1792) 166524aprefer-top-level-await
rule to recommended preset (#1803) 6f5ecf5import-index
rule (#1787) 0034e69text-encoding-identifier-case
: Ignore JSX meta[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 in for..in
and for..of
(#1824) d3b2548no-useless-undefined
: Ignore ref(undefined)
in Vue project (#1828) e7306e5prefer-node-protocol
: Always check require()
(#1827) 2c914d4no-array-for-each
: Improve parameter reassign detection (#1823) 56df468no-array-for-each
: Add fix for arrow function body (#1785) 59218e3no-array-for-each
: Fix auto-fix causing SyntaxError (#1813) 47c8337https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v42.0.0...v43.0.0