npm / eslint-plugin-unicorn
eslint-plugin-unicorn
What changed in eslint-plugin-unicorn 20 to 80, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
99 breaking5 security3 deprecations419 new APIs and options9 performance290 behavior and defaults18 tooling334 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initeslint-plugin-unicorn 8029 changes
Breaking changes 10
The rule ignores underscore-only parameters in TypeScript type signatures.
The rule is no longer included in the recommended and unopinionated presets and is now opt-in.
The rule detects async callbacks in unreassigned local let and var bindings.
The rule checks generic functions and autofixes type-safe removals when type information is available.
Node.js 22.13 is now required to use the plugin.
The rule handles ternaries with a null or undefined branch in truthiness checks.
In TypeScript, the rule reports only comparisons of known numbers.
The rule now supports member chains.
The rule ignores .cts files.
The rule ignores if chains that would put an else if inside default.
New APIs and options 9
Adds a checkCollections option.
The rule simplifies longer ternary chains.
A new rule is available to prefer an options parameter.
A new rule is available to prefer RegExp.prototype.exec.
Adds a checkTypeAliases option.
Adds a checkNestedTernaries option.
Adds the checkBufferDecoding option and autofixes Buffer.fromBase64().
Adds the checkBufferDecoding option and autofixes Buffer.fromHex().
A new rule is available to require parentheses around spread expressions.
Performance 1
Rules are loaded lazily to improve import performance.
Behavior and default changes 5
The rule detects async callbacks in unreassigned local let and var bindings.
The rule autofixes more consecutive initializations.
The rule ignores Object.setPrototypeOf(foo, null).
The rule factors comparisons with any comparison operator.
The rule ignores strings in import and export specifiers.
Tooling 2
The rule now reports redundant double-negation coercions.
The rule detects JSON loaded through createRequire() and can autofix it.
Fixes and other changes 2
JSDoc type inference is preserved when an ESLint directive comment separates the JSDoc comment from the code.
The rule ignores return undefined in getters.
eslint-plugin-unicorn 7929 changes
Breaking changes 1
The no-top-level-side-effects rule is no longer included in this preset.
New APIs and options 2
Adds an ignore option to comment-content.
Enable this option to check unknown calls more strictly.
Performance 1
Improves performance.
Behavior and default changes 10
Potentially behavior-changing fixes in rare cases are now suggestions, including fixes in several named rules.
Functions in Vitest hoisted factories are now ignored.
Rules that use type information now infer types from JSDoc @type, @param, and @returns annotations.
Shorthand destructuring is now ignored.
Unknown calls are no longer reported by default; mutations of globals are reported, including in declarations and default exports.
Checks .find() results when they are used as booleans.
Reports negated and typed loose comparisons, and preserves TypeScript union narrowing.
Uses suggestions for changes that can affect numeric results.
Handles equivalent logical expressions and factors common terms in longer chains and static templates.
Checks TypeScript type aliases.
Fixes and other changes 15
More autofixes preserve comments in affected code.
Many rules' autofixes no longer produce broken code or incorrect parentheses.
Abstract TypeScript classes are now ignored.
Recognizes more configuration helpers.
Preserves boolean return types in TypeScript.
Skips unsafe logical OR fallbacks.
Skips search values incompatible with TypeScript types.
Preserves escaped trailing spaces in templates.
Skips minimizations that would break types.
Improves handling of typeof comparisons and guards.
Preserves TypeScript literal types in autofixes.
Preserves consecutive early-return guards.
Skips methods with incompatible types.
More rules handle template literals without expressions like strings.
Ignores calls that return functions.
eslint-plugin-unicorn 7835 changes
Breaking changes 1
Rules that skipped code with comments now report it, withholding fixes only when they would remove comments.
Security 2
Prevents unsafe TypeScript object autofixes.
Prevents unsafe TypeScript autofixes.
New APIs and options 4
Adds a rule for detecting repeated call wrappers.
Adds a rule for detecting unnecessary default arguments.
Checks TypeScript instantiation expressions.
Combines non-literal exits in TypeScript when type information is available.
Behavior and default changes 10
Allows the does prefix by default.
Supports && and || chains of negated operands.
Allows known pure imported helpers, such as defineConfig() and React memo(), and checks default-exported expressions.
Supports static template literal fallbacks.
Supports fallbacks to earlier bindings.
Checks let and var listener functions, and ignores reassigned listeners.
Supports destructuring assignments.
Supports statements that differ in only one part, such as call(test ? a : b).
Allows cached promise assignments.
Adds support for complex Markdown labels, embedded HTML in Markdown, JSX, URL.canParse(), URL.parse(), and more HTML attributes.
Fixes and other changes 18
Recognizes promise-returning functions.
Fixes cyclic type parameter resolution.
Removes shared indentation.
Clarifies the message for nested await.
Combines a declaration with an assignment that follows it immediately.
Fixes a false positive for recursive defaults.
Ignores parameters named by type predicates.
Fixes false positives for DOM collections.
Handles nullable fallback types.
Suggests opposite relational comparisons.
Handles non-boolean conditions.
Ignores formatting differences in shared expressions.
Does not autofix reassigned methods and suggests private arrow functions for bound methods.
Ignores queries on more non-element roots, such as ownerDocument and getRootNode().
Avoids false positives on non-promise calls.
Allows bare export {} in declaration files.
Ignores templates with content on the opening line.
Fixes cyclic resolution in type-aware checks.
eslint-plugin-unicorn 7769 changes
Breaking changes 17
In logical mode, the rule now reports unnecessary boolean casts.
eslint-disable comments now suppress reports instead of making rules skip the code, avoiding directives that look unused.
Deprecated flat/all config was removed; use all instead.
Deprecated flat/recommended config was removed; use recommended instead.
Rule now supports CSS and JSON and is enabled in the recommended preset.
Rule now reports nested await expressions.
CSS-only rule moved to eslint-cssicorn as cssicorn/no-deprecated-features.
CSS-only rule moved to eslint-cssicorn as cssicorn/no-duplicate-selectors.
CSS-only rule moved to eslint-cssicorn as cssicorn/no-duplicate-font-family-names.
CSS-only rule moved to eslint-cssicorn as cssicorn/no-invalid-media-features.
CSS-only rule moved to eslint-cssicorn as cssicorn/no-nesting-with-mixed-specificity.
CSS-only rule moved to eslint-cssicorn as cssicorn/no-redundant-nested-style-rules.
CSS-only rule moved to eslint-cssicorn as cssicorn/no-unknown-annotations.
CSS-only rule moved to eslint-cssicorn as cssicorn/no-unknown-pseudo-selectors.
CSS-only rule moved to eslint-cssicorn as cssicorn/no-unscoped-nesting-selector.
CSS-only rule moved to eslint-cssicorn as cssicorn/prefer-explicit-viewport-units.
CSS-only rule moved to eslint-cssicorn as cssicorn/prefer-media-feature-range-syntax.
New APIs and options 36
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
Adds the checkMultiStatementBodies option.
New rule is available.
New rule is available.
New rule is available.
New rule is available.
Adds the negatedConditions option.
Recommended preset for CSS is now available.
Recommended preset for HTML is now available.
Recommended preset for JSON is now available.
Recommended preset for Markdown is now available.
Recommended preset for TOML is now available.
Recommended preset for YAML is now available.
New rule is available.
Performance 1
Rule performance improved.
Behavior and default changes 10
Rule now supports computed properties.
Rule now prefers repository over repo.
Rule now supports block comments and CSS.
Rule now removes unnecessary singleton array wrappers.
Rule moved from the unopinionated preset to the recommended preset.
Rule now reports bindings with consistent fallback expressions.
Rule now simplifies only boolean branches.
Rule now handles typeof guards.
Rule now inlines local sources.
Rule now recognizes more encoding patterns.
Fixes and other changes 5
Rule avoids false positives for spread arguments.
Shorthand detection improved.
Type inference for destructured bindings is fixed.
Checks guards after other statements in checkShortBodies.
Array call autofixes are now safe.
eslint-plugin-unicorn 768 changes
New APIs and options 3
Adds the checkContinue option and defaults it to off.
Adds the checkConditionals option and defaults it to off.
Adds the checkCompoundConditions option and defaults it to off.
Behavior and default changes 4
The rule now ignores TypeScript ambient variables.
The rule now handles boolean expressions.
The rule now provides an autofix.
The rule now preserves readable branches.
Fixes and other changes 1
Autofixes no longer hardcode a tab for inserted indentation.
eslint-plugin-unicorn 7543 changes
New APIs and options 26
Adds the directoryRoots option.
Adds a rule against async iterator callbacks.
Adds a rule for deprecated CSS features.
Adds a rule for duplicate CSS selectors.
Adds a rule for duplicate font family names.
Adds a rule for invalid media features.
Adds a rule for nesting with mixed specificity.
Adds a rule for redundant nested style rules.
Adds a rule for unknown CSS annotations.
Adds a rule for unknown pseudo-selectors.
Adds a rule for unscoped CSS nesting selectors.
Adds a rule for unused built-in method return values.
Adds a rule for unused iterator helpers.
Checks for…of loops.
Adds a rule for useless Set construction.
Adds a rule for resource escapes from using declarations.
Adds a rule for preferring combined guards.
Adds the checkShortBodies option.
Adds a rule preferring iterator helpers.
Adds a rule preferring iterator zip.
Adds a rule preferring JSON imports.
Adds a rule preferring media feature range syntax.
Checks property reads with checkComputedMemberAccess.
Adds a rule preferring Temporal conversion.
Adds a rule preferring Uint8Array hexadecimal conversion.
Adds TOML support.
Performance 1
Improves performance.
Behavior and default changes 8
Allows flexible options placement.
Supports conditionals.
Allows safe repeated strings.
Supports trailing conditionals.
Combines consecutive mutations.
Supports objects, arrays, and constructors.
Extends supported methods.
Checks initialized declarations.
Tooling 1
Prefers native encoding options.
Fixes and other changes 7
Recognizes function return types.
Preserves comments in autofixes.
Fixes identifier lookup across @eslint/css-tree versions.
Prevents unsafe combined fixes.
Recognizes ordinary serial mapping loops.
Recognizes accumulation loops.
Handles flat return statements.
eslint-plugin-unicorn 7414 changes
Performance 1
Rule performance was improved.
Behavior and default changes 10
The rule now handles JSDoc syntax.
The rule now supports possibly async boolean callbacks.
Custom error bases no longer require native
ErrorOptions.The rule now supports TypeScript parameter properties.
The rule now supports YAML.
The rule now allows the
ProcessEnvtype.The rule now ignores canvas contexts.
The rule now supports YAML.
The rule now supports stage 4 proposals.
The rule now supports logical assignment operators.
Fixes and other changes 3
Fixes indentation and handling of the
inoperator.Fixes false positives when the return value is used.
Fixes a false positive in mutable branch conditions.
eslint-plugin-unicorn 7321 changes
Security 1
Adds the no-unsafe-sqlite-interpolation rule.
New APIs and options 8
Adds the consistent-arrow-return-style rule.
Adds granular check options, including checkVariables, to consistent-boolean-name.
Adds the wrappers option to consistent-boolean-name.
Adds the defaultExport option to consistent-function-style.
Adds the iteration-fallback-style rule.
Adds the no-barrel-files rule.
Adds the ignore option to prefer-https.
Adds the single-line-block-comment-style rule.
Performance 1
Improves performance.
Behavior and default changes 4
Ignores type-only imports.
No longer checks relational operators.
Allows explicit TypeScript this parameters.
Treats == null checks as simple conditions.
Fixes and other changes 7
Handles Unicode word boundaries.
Fixes decorator position reporting.
Handles TypeScript parameter properties.
Handles Zod string schemas.
Handles existing else-if chains.
Fixes false positives for computed members.
Fixes control-flow analysis for process.exit.
eslint-plugin-unicorn 7228 changes
Breaking changes 2
Adds the rule to the recommended preset.
Renames the checkVaryingCallee option to checkVaryingBase.
New APIs and options 12
Adds a rule for detecting missing local resources.
Adds a rule for detecting multiple promise resolver calls.
Adds a rule for detecting shorthand property overrides.
Adds a rule for detecting transition-all usage.
Adds a rule for detecting unnecessary string trimming.
Adds a rule for detecting useless re-exports.
Adds an async IIFE suggestion.
Adds options to the rule.
Adds a rule for preferring explicit viewport units.
Adds the consistent-as-needed option.
Adds a rule for preferring then-catch promise handling.
Adds a rule for requiring frontmatter fields.
Behavior and default changes 11
The rule now supports Vue refs.
The rule now ignores Unicode code point escapes.
The rule now ignores relational comparisons with optional chaining.
The rule now ignores <script setup>.
The rule uses type information for narrowed property keys.
The rule now ignores expect assertions.
The rule now handles awaited calls.
The rule now ignores const assertions.
By default, the rule no longer reports object-varying member access.
The rule now supports array destructuring.
The rule now detects slice comparisons.
Fixes and other changes 3
The rule now handles TypeScript Vue files.
The rule now preserves JSDoc comments on single-const re-exports.
Fixes the rule's logic.
eslint-plugin-unicorn 719 changes
Behavior and default changes 7
The rule now allows async boolean predicates.
The rule now allows boolean-like React refs with a Ref suffix.
The rule ignores destructured variables.
React hooks are skipped by default.
The rule ignores repeated boolean guard clauses.
The rule ignores Svelte files.
The rule is removed from presets.
Fixes and other changes 2
The rule respects configured globals in isolated functions.
In TypeScript, the rule ignores conditional flatMap fixes.
eslint-plugin-unicorn 7021 changes
New APIs and options 10
Adds a rule for detecting async Promise finally callbacks.
Adds an ignore option to the rule.
Adds a rule for detecting unnecessary fetch options.
Adds a rule for detecting unsafe Promise.allSettled values.
Adds a rule for preferring AbortSignal.any.
Adds a rule for preferring Array.flatMap.
Adds a rule for preferring Array.from for ranges.
Adds a rule for preferring block statements over IIFEs.
Adds a rule for preferring groupBy.
Adds a rule for preferring simplified conditions.
Behavior and default changes 8
The rule now supports inverse boolean names.
The rule now reports unsupported catalog versions.
The rule adds defaults for workerize and common evaluate APIs.
The rule now supports methods.
The rule now handles more cases.
The rule now recognizes process.exit() as an exiting branch.
The rule now ignores empty statements.
The rule now catches more callback methods.
Fixes and other changes 3
The rule now handles conditional member keys.
Fixes false positives from the rule.
The rule now ignores empty statements.
eslint-plugin-unicorn 6938 changes
New APIs and options 15
Adds an
ignoreoption and supports plural prefixes.Adds a rule for consistent tuple labels.
Adds a rule for invalid well-known symbol methods.
Adds a rule for late event control.
Allows the
voidoperator to opt out.Adds a rule preferring AbortSignal timeout usage.
Adds a rule preferring AggregateError.
Adds a rule preferring DOM node replaceChildren.
Adds a rule preferring Error.isError.
Adds a
checkVaryingCalleeoption.Adds a rule preferring observer APIs.
Adds a rule preferring Promise.try.
Adds a rule preferring Set methods.
Adds a rule preferring toggleAttribute.
Adds a rule preferring URL search parameters.
Behavior and default changes 7
Treats
undefinedandnullfallbacks as an empty branch.Allows dynamic access to a known boolean value.
Allows
stackonErrorinstances.Allows type-only exports.
No longer reports existence checks.
Allows computed keys when a rest element is present.
Only checks positive string index access when
checkAllIndexAccessis enabled.
Fixes and other changes 16
No longer mutates commented-out multi-line code.
No longer crashes on Svelte
{#each}bindings.Allows a no-substitution template literal for
name.Does not require an
optionsparameter when it is forwarded tosuper()inline.Excludes Vite type declarations.
Ignores braces inside block comments.
Does not report custom
pushmethods that do not return arrays.Fixes false positives for destructured parameters and yield expressions.
Ignores non-string receivers.
Restricts
values()reporting to arrays.Keeps
Boolean()around possibly-undefinedvalues.Skips concatenations that form a
${…}placeholder.Autofixes
elsebodies containing JSX.Improves fixes.
Does not suggest the swap when the result feeds arithmetic.
Does not report when the
ifbody exits the loop.
eslint-plugin-unicorn 6864 changes
Breaking changes 2
Replaces the
prevent-abbreviationsrule name; update configurations to usename-replacements.Removes
prefer-type-literal-lastfrom theunopinionatedpreset.
Security 1
Rules are hardened.
New APIs and options 38
Adds the
consistent-conditional-object-spreadrule.Adds the
default-export-stylerule.Adds the
no-accidental-bitwise-operatorrule.Adds the
no-array-concat-in-looprule.Adds the
no-array-front-mutationrule.Adds the
no-array-sort-for-min-maxrule.Adds the
no-boolean-sort-comparatorrule.Adds the
no-chained-comparisonrule.Adds the
no-collection-bracket-accessrule.Adds the
no-constant-zero-expressionrule.Adds the
no-double-comparisonrule.Adds the
no-duplicate-if-branchesrule.Adds the
no-duplicate-logical-operandsrule.Adds the
no-impossible-length-comparisonrule.Adds the
no-invalid-character-comparisonrule.Adds the
no-loop-iterable-mutationrule.Adds the
no-misrefactored-assignmentrule.Adds the
no-nonstandard-builtin-propertiesrule.Adds the
no-selector-as-dom-namerule.Adds the
no-unnecessary-boolean-comparisonrule.Flags
+value,value + '', andvalue.toString()idioms.Adds the
no-useless-compound-assignmentrule.Adds the
no-useless-delete-checkrule.Adds the
no-useless-logical-operandrule.Adds the
no-xor-as-exponentiationrule.Adds the
prefer-array-from-asyncrule.Adds the
prefer-array-iterable-methodsrule.Adds the
prefer-boolean-returnrule.Adds the
prefer-continuerule.Adds the
prefer-flat-math-min-maxrule.Adds the
prefer-hoisting-branch-coderule.Adds the
prefer-math-constantsrule.Adds the
prefer-promise-with-resolversrule.Adds the
prefer-regexp-escaperule.Adds the
prefer-single-replacerule.Adds the
prefer-unary-minusrule.Adds the
prefer-url-can-parserule.Adds the
prefer-while-loop-conditionrule.
Behavior and default changes 12
No longer checks destructured bindings.
Adds more default replacements.
Covers more builtins.
Only reports fresh, non-escaping local arrays.
Removes the rule from the
unopinionatedpreset.Allows intrinsic string-mapping types as keys.
Flags
return undefinedforvoidreturn type.Adds support for
.filter(…).slice(-1).Reports dynamic computed-key swaps.
Adds
parseFloatsupport.Removes
prefer-short-arrow-methodfrom therecommendedpreset, so the preset no longer enables it.Stops checking intersection types.
Fixes and other changes 11
No longer assumes the base rule's
defaultOptionsexist.Improves the rule's error message.
Handles unlabeled
continuein nestedswitchstatements.Ignores initializers containing
awaitoryield.Fixes a false positive.
Ignores some more comments.
Autofixes no longer drop comments.
Fixes lexical declaration autofixes.
Checks import attribute keys.
Ignores distinct expressions compared against
undefined.Preserves TypeScript casts on value access.
eslint-plugin-unicorn 6735 changes
Breaking changes 1
Disallows property targets in object destructuring.
Security 1
Hardens the rule.
New APIs and options 15
Adds a rule for enforcing consistent names for boolean variables.
Adds a rule for logical assignment operators.
Adds a rule for disallowing array splice.
Adds a rule for invalid argument counts.
Adds a rule for non-function names with verb prefixes.
Adds a rule for top-level assignments in functions.
Adds a rule for uncalled methods.
Adds a rule for unreadable for-of expressions.
Adds a rule for useless continue statements.
Adds a rule for useless overrides.
Adds a rule for operator assignments.
Adds a rule for preferring array slice.
Adds a rule for preferring else-if.
Adds a rule for preferring has checks.
Adds a rule for preferring Map.fromEntries.
Behavior and default changes 10
Removes the rule from the recommended preset, so it is no longer enabled by that preset.
Skips non-prose comments.
Groups static methods with other static members.
With preferAttributes, flags .dataset when it is assigned to a variable.
Suggests Math.sumPrecise() for sum reduces.
Disallows property targets in array destructuring.
Removes the rule from the recommended preset, so it is no longer enabled by that preset.
Ignores template literal types.
Reports partially-scoped selector lists.
Keeps null and undefined last.
Tooling 1
Disallows using push() and unshift() return values.
Fixes and other changes 7
Improves the rule's error message.
Hardens side-effect detection.
Ignores React hook calls.
Does not report non-empty files parsed by a plain-text parser.
Does not flag unique symbol keys.
Improves detection of nullish ternaries.
Applies only to combined selectors.
eslint-plugin-unicorn 66139 changes
Breaking changes 6
The rule stops expanding destructuring.
ESLint 10.4 is now required to use this release.
The no-array-for-each rule is renamed to no-for-each; update rule configuration accordingly.
This rule is dropped and replaced by prefer-unicode-code-point-escapes, which covers more cases.
Node.js 22 is now required to use this release.
A new rule is available and replaces no-hex-escape while covering more cases.
New APIs and options 76
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
The rule adds a peer condition.
A new rule is available to configure.
The rule adds the camelCaseWithAcronyms case.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
A new rule is available to configure.
The rule adds a single-statement option.
Performance 1
The rule's performance is improved.
Behavior and default changes 40
The rule now ignores props.children.
The rule now allows the newLine word.
The rule now tracks JSX references.
The rule detects length <= 0 as a zero-length check.
The rule now allows acronyms in pascal case.
The rule now supports node: builtins.
The rule now ignores JSX wrappers.
The rule now ignores non-array TypeScript receivers.
The rule now supports all file extensions.
The rule now supports cached length loops.
The rule normalizes legacy MIME types.
The rule now respects Browserslist configuration.
The rule now supports inline TypeScript object type literals.
The rule now supports ternary expressions.
The rule now checks object spread in Object.assign().
In TypeScript files, case null and case undefined are allowed before default.
The rule now handles guarded indexed access.
The rule now ignores TypeScript call arguments.
The rule stops reporting plain concat normalization.
The rule now supports .filter(…).flatMap(…).
The rule now supports for-of array mapping.
The rule now prefers at() for string indexing.
The rule now ignores well-known XML namespace URIs.
The rule simplifies boolean array predicates.
The rule now checks parseInt.
The rule now handles .replaceChildren().
The rule now ignores type predicates.
The rule now checks legacy integer patterns.
The rule auto-fixes isNaN/isFinite when the argument is a number.
The rule now checks for-of loops.
The rule's TypeScript support is improved and it supports String#search() checks.
The rule now supports String#search() checks.
The rule handles trivial for...of copies and improves concat() array detection; it stops checking String#split('').
The rule stops checking String#split('').
The rule allows more regex flags for string fixes.
The rule now detects indexOf() === 0.
The rule now ignores literal discriminants.
The rule no longer flags typeof x === 'undefined' existence checks.
The rule now ignores e2e and a11y.
The rule ignores sql tagged templates.
Tooling 2
The rule checks single-character substring calls and prefers at() for string indexing.
The rule now provides an autofix.
Fixes and other changes 14
Fixes false positives involving loop captures.
The rule now preserves Error#cause.
Fixes false positives.
The rule's autofix reliability is improved.
The rule now guards unsafe .entries() autofixes.
The rule now handles TypeScript wrappers.
The rule can autofix the first element of Promise.all.
The rule has fewer false positives.
The rule now ignores non-array find checks.
The rule no longer flags typeof existence checks.
The rule improves concat() array detection.
The rule detects let declarations reassigned in an if statement and only reports captured values.
The rule only reports captured values.
Fixes an incorrect autofix involving a comment.
eslint-plugin-unicorn 6591 changes
Breaking changes 7
The rule was dropped because it is too broken and not feasible to fix.
Renames the
prefer-dom-node-datasetrule todom-node-dataset.Renames
ignoreDatestocheckDatesand makescheckDatestrue by default.Renames
ignoreDatesOnPullRequeststocheckDatesOnPullRequests.Checks directories as well as filenames.
Renames
ignoreUsedVariablestocheckUsedVariables.The rule no longer exempts WebWorker-specific APIs.
New APIs and options 42
Adds the
better-dom-traversingrule.Adds the
consistent-compound-wordsrule.Adds the
consistent-json-file-readrule.Adds the
preferAttributesoption todom-node-dataset.Adds an
ignoreoption.Adds the
no-array-fill-with-reference-typerule.Adds the
no-array-from-fillrule.Adds the
no-blob-to-filerule.Adds the
no-canvas-to-imagerule.Adds the
no-confusing-array-splicerule.Adds the
no-duplicate-set-valuesrule.Adds an
allowCommentsoption.Adds the
no-exports-in-scriptsrule.Adds the
no-incorrect-query-selectorrule.Adds the
no-invalid-file-input-acceptrule.Adds the
no-late-current-target-accessrule.Adds the
no-manually-wrapped-commentsrule.Adds a
checkArgumentsoption.Adds the
no-this-outside-of-classrule.Adds the
no-unnecessary-nested-ternaryrule.Adds the
no-unused-array-method-returnrule.Adds a
fractionGroupLengthoption.Adds the
prefer-array-last-methodsrule.Adds the
prefer-get-or-insert-computedrule.Adds the
prefer-httpsrule.Adds the
prefer-includes-over-repeated-comparisonsrule.Adds the
prefer-iterator-concatrule.Adds the
prefer-iterator-to-array-at-endrule.Adds the
prefer-math-absrule.Adds an
allowWithVariablesoption.Adds the
prefer-queue-microtaskrule.Adds a
minimumItemsoption.Adds the
prefer-split-limitrule.Adds the
prefer-string-match-allrule.Adds the
prefer-string-pad-start-endrule.Adds the
prefer-string-repeatrule.Enforces
replaceAlloversplit().join().Adds the
require-css-escaperule.Adds the
require-passive-eventsrule.Adds a
caseSensitiveoption.Adds a
selectorsoption.Adds the
try-complexityrule.
Performance 1
Improves rule performance.
Behavior and default changes 8
Adds CSS support.
Allows
$-prefixed filenames.Reports spreading into collection constructors.
Ignores
arguments.Allows compatible extra usages.
Adds
unshift()support.Adds suggestions for ambiguous replacements.
Allows bare
export {}as a module marker.
Tooling 2
Adds autofix support.
Forbids unnecessary
String.raw.
Fixes and other changes 31
Fixes false positives on type assertions.
Fixes false positives on XML namespace URIs.
Fixes type guards.
Ignores functions in Jest mock factories.
Handles custom error message accessors.
Ignores nullable property guards.
Fixes a false positive.
Warns about misuse when all styles are set to
false.Uses singular callback parameter names.
Fixes handling of local callbacks.
Ignores
strict-callbag-basicsnamespaces.Fixes fixer overlap with whole-range fixes.
Fixes false positives for multi-feature imports.
Ignores
Promise.resolve(undefined)in TypeScript.Detects assigned
findresults.Avoids reporting object index access.
Fixes the append API label.
Improves the fixer.
Handles more cases.
Fixes length checks.
Ignores RTK action matchers.
Improves the TypeScript autofix.
Fixes false positives for strings.
Improves autofix.
Ignores variable initializers.
Fixes behavior under
@typescript-eslint/parser.Ignores Zod schema catch fallback.
Avoids unsafe parameter autofixes.
Fixes tagged template escape rules.
Fixes root indentation detection.
Fixes a decorator false positive.
eslint-plugin-unicorn 6429 changes
Breaking changes 1
The rule now flags
return undefinedwhen the return type explicitly includes undefined.
New APIs and options 5
Adds a rule for consistent escaping in template literals.
Adds the
ignoreDatesoption.Adds a rule for detecting useless conversions of iterators to arrays.
Adds a rule for putting the simpler condition first.
Adds a rule for switch-case break placement.
Performance 1
The rule's performance is improved.
Behavior and default changes 6
The rule now skips TypeScript type predicate callbacks.
The rule now ignores Date objects.
The rule now handles exported TypeScript interfaces and enums.
The rule now recognizes jQuery.
The rule now supports template literals.
Many rules now support TypeScript type assertions.
Fixes and other changes 16
Fixes the empty-pattern autofix.
Fixes a false positive for nested rest destructuring.
Fixes a false positive after reassignment.
Fixes TypeScript false positives for lexical
this.Fixes the class field autofix.
Fixes partial version comparison.
Fixes false positives involving
||fallbacks.Avoids unsafe autofixes in negated comparisons.
Fixes a false positive for type-only imports.
Fixes handling of JSX member access.
Fixes handling of window-specific
inchecks.Fixes false positives for TypeScript type predicates.
The rule avoids auto-fixing generic reduce calls.
Fixes false positives involving strings.
Autofix is skipped when it would drop comments.
Fixes a false positive involving
Promise.all.
eslint-plugin-unicorn 6319 changes
New APIs and options 1
Adds the isolated-functions rule.
Behavior and default changes 3
Adds support for signed numbers and strings.
Checks
Iterator#toArray()andString#split().Adds Array.from() support.
Tooling 1
Adds support for ESLint 10.
Fixes and other changes 14
Explicitly checks the specifier node type.
Does not flag ESLint disable comments.
Ignores
||with a string fallback value.Fixes a crash on
export {x}without afromclause.Ignores TypeScript types.
Ignores
.sort()calls with non-function arguments.Skips autofixes for string types when
.entries()would be needed.Fixes false positives for graduated
esnextfeatures.Uses suggestions to remove empty arrays that have comments.
Fixes a false positive on
Iterator.Avoids autofixing non-function assignments.
Prevents type-imports from being removed when using a namespace import.
Skips TypedArray and ArrayBuffer constructor calls.
Excludes inline snapshots.
eslint-plugin-unicorn 6215 changes
New APIs and options 6
Adds the no-immediate-mutation rule.
Adds the no-useless-collection-argument rule.
Adds the prefer-response-static-json rule.
Checks optional chaining.
Adds the withDash option.
Enforces 'utf-8' in form[acceptCharset] and TextDecoder.
Behavior and default changes 4
Ignores forEach for the Effect library.
Checks one undefined at a time.
Adds navigation to windowSpecificAPIs.
Adds support for template literals.
Fixes and other changes 5
Fixes inconsistent behavior.
Safely removes empty arrays and objects.
Reports cases where String.fromCharCode is not called directly.
Handles TypeScript import types.
Ignores more places that require a string.
eslint-plugin-unicorn 619 changes
New APIs and options 5
Adds a rule for disallowing Array.prototype.sort.
Adds a rule that prefers BigInt literals.
Adds a rule that prefers classList.toggle.
Adds a rule for requiring module attributes.
Adds the unopinionated config.
Behavior and default changes 2
Reports optional chaining and calling of .reduce().
Ignores error type checks.
Fixes and other changes 2
Improves compatibility with optional chaining.
Fixes compatibility with Vue SFC.
eslint-plugin-unicorn 609 changes
Breaking changes 2
Node.js 20.10 is now required to use eslint-plugin-unicorn.
The rule no longer ignores optional chaining expressions.
New APIs and options 4
A new rule is available to flag uses of Array#reverse.
A new rule is available to flag useless Error.captureStackTrace calls.
A new rule is available to enforce preferring class fields.
A new rule is available to require module specifiers.
Tooling 1
eslint-plugin-unicorn now supports SuppressedError.
Fixes and other changes 2
The rule now handles the experimental pipeline operator correctly.
The rule now preserves escapes.
eslint-plugin-unicorn 598 changes
Breaking changes 2
The rule was renamed from no-length-as-slice-end to no-unnecessary-slice-end.
The rule was renamed from no-array-push-push to prefer-single-call.
New APIs and options 4
Support for Float16Array was added.
A new rule was added.
A new rule was added.
A new rule was added.
Behavior and default changes 2
The rule now supports checking Infinity.
The rule now supports process.getBuiltinModule().
eslint-plugin-unicorn 587 changes
New APIs and options 2
Add a
caseoption to the rule.Add a
hexadecimalValueoption to the rule.
Fixes and other changes 5
Update the declared Node.js engine compatibility to match real compatibility.
Fix an exception when the rule is used in CommonJS.
Fix the browserslist field name used by the rule.
Fix a crash when checking the
es6-errormodule.Preserve
iOSwhen checking for abbreviations.
eslint-plugin-unicorn 5716 changes
Breaking changes 3
The plugin now requires ESLint 9.20.0 or later.
The rule now treats util and utils as abbreviations.
The package is now pure ESM, changing how developers import and use it.
Deprecations 1
Deprecates no-instanceof-array and recommends no-instanceof-builtins instead.
New APIs and options 4
Adds the consistent-assert rule.
Adds the consistent-date-clone rule.
Adds the no-accessor-recursion rule.
Adds the no-named-default rule.
Behavior and default changes 3
The rule no longer offers an unsafe autofix for .slice with one argument.
The rule now supports Vue templates.
The rule now ignores BigInt.
Fixes and other changes 5
Corrects the rule's fix for Date().
The rule now excludes outerWidth and outerHeight.
Fixes the autofix for typeof window.
The rule reduces false positives in TypeScript.
The rule now ignores ImportAttribute.
eslint-plugin-unicorn 568 changes
New APIs and options 3
Adds a new rule that developers can enable in their ESLint configuration.
Adds a new rule that developers can enable in their ESLint configuration.
Adds a new rule that developers can enable in their ESLint configuration.
Behavior and default changes 3
Removes
better-regexfrom the recommended rules, so users relying on the recommended configuration will no longer have it enabled automatically.The rule now ignores React 19
useRefcalls.The rule now supports
getElementsByName.
Fixes and other changes 2
Removes an invalid fix for TypeScript.
Removes the unsafe autofix for
String#substr().
eslint-plugin-unicorn 555 changes
New APIs and options 1
Adds the no-length-as-slice-end rule.
Behavior and default changes 1
Ignores Bun modules.
Tooling 1
Adds TypeScript types for the package.
Fixes and other changes 2
Ignores boolean type casting.
Removes the broken autofix for Promise.all().
eslint-plugin-unicorn 547 changes
Breaking changes 1
Changes the checkFromLast default value to true.
New APIs and options 2
Adds the no-negation-in-equality-check rule.
Checks Array#findIndex() and Array#findLastIndex().
Behavior and default changes 1
Checks .lastIndexOf().
Tooling 1
Adds a name to flat configs.
Fixes and other changes 2
Fixes edge cases when adding new to calls.
Ignores strings in Enums.
eslint-plugin-unicorn 5315 changes
Breaking changes 2
Node.js 18.18 is now required to use the project.
The rule checks all call expressions instead of only arguments of ThrowStatement.
New APIs and options 6
Adds the consistent-empty-array-spread rule.
Adds the no-invalid-fetch-options rule.
Adds the no-magic-array-flat-depth rule.
Adds the checkNaN option.
Adds the prefer-string-raw rule.
Adds the prefer-structured-clone rule.
Behavior and default changes 3
The rule ignores String.raw.
The rule now checks Array.fromAsync() calls.
Supports member expression paths in the tags and functions options.
Tooling 1
Adds support for ESLint 9.
Fixes and other changes 3
The rule ignores String.raw.
The rule ignores awaited getAttribute calls.
The rule supports non-ASCII filenames.
eslint-plugin-unicorn 529 changes
New APIs and options 4
Adds an option for handling multiple file extensions.
Adds a rule for detecting anonymous default exports.
Adds a rule for detecting
awaitin promise methods.Adds a rule for detecting a single promise inside promise methods.
Behavior and default changes 3
Now checks logical expressions and analyzes ternaries more deeply.
Now checks
array.filter().at(0).Now checks
Object.prototypemethods accessed fromglobalThis.
Fixes and other changes 2
Handles uppercase class names.
No longer reports on optional chaining.
eslint-plugin-unicorn 514 changes
Behavior and default changes 2
Removed from the recommended preset, so projects using that preset no longer enable this rule by default.
The rule now checks Array.from() calls.
Fixes and other changes 2
Fixed a crash when the rule encounters
{[Symbol.prototype]: 0}.Fixed the argument passed to isMethodCall.
eslint-plugin-unicorn 506 changes
New APIs and options 2
A new rule detects unnecessary polyfills.
Adds the checkArrowFunctionBody option.
Behavior and default changes 2
The rule now ignores React state setters.
The rule now checks TypedArray#subarray().
Fixes and other changes 2
The rule now allows
moduleas a TSTypeParameter name.Fixes JSX autofix behavior for newlines and related cases.
eslint-plugin-unicorn 494 changes
New APIs and options 1
Supports the RegExp
vflag.
Behavior and default changes 2
The rule now supports monorepos.
The rule now ignores
EventEmitterfrom@angular/coreandeventemitter3.
Fixes and other changes 1
The rule allows
moduleas a TSIndexSignature name or a TSTypeAliasDeclaration id.
eslint-plugin-unicorn 4813 changes
Deprecations 1
The rule is deprecated.
Behavior and default changes 5
The rule ignores
.length || numberexpressions.The rule ignores process exits when using the
node:worker_threadsmodule.The rule turns a parameter with an
undefineddefault value into an optional parameter.The rule ignores filter calls with a literal argument.
The rule ignores promises inside
Promise.all,Promise.allSettled,Promise.any, andPromise.race.
Tooling 1
The rule checks cases where
Math.hypot()should be preferred.
Fixes and other changes 6
Fixes a crash on array holes.
Fixes an edge case in the rule.
Fixes the
Object.fromEntries()check.Fixes edge cases in the rule.
Removes the broken fix for
element.setAttribute.Fixes an incorrect auto-fix.
eslint-plugin-unicorn 4710 changes
Breaking changes 3
The plugin now requires eslint@>=8.38.0.
Node.js 16 is now required to use the plugin.
The rule is now enabled in the recommended config.
New APIs and options 1
A new rule is available to prefer Blob reading methods.
Behavior and default changes 4
The rule now checks optional chaining.
The rule now checks optional chaining.
The rule no longer checks
Array.fromcalls that use a map function.The rule now ignores
.cjsfiles.
Fixes and other changes 2
The rule now checks optional chaining.
False positives in the rule were fixed.
eslint-plugin-unicorn 467 changes
Breaking changes 1
Forbids using Array#toSpliced() to copy an array.
Behavior and default changes 4
Supports .jsx and .tsx file extensions.
Checks Array methods toReversed, toSorted, toSpliced, and with.
Checks .toSpliced() and .with().
Adds elems to the rule’s abbreviations.
Fixes and other changes 2
Stops normalizing package.json.
Supports Array methods toReversed, toSorted, toSpliced, and with.
eslint-plugin-unicorn 4515 changes
Breaking changes 1
The rule now reports all String#replace() calls when the pattern has the
gflag.
New APIs and options 3
Adds the no-negated-condition rule.
Adds the no-typeof-undefined rule.
Adds the prefer-set-size rule.
Behavior and default changes 6
The rule now checks cloning inline arrays.
The rule now ignores Array#includes() and Set#has().
The rule now supports private fields.
The rule now uses suggestions when it is unsure about a regex without the
gflag.The rule now ignores regexes with a pipe.
The rule now ignores expressions in classes.
Fixes and other changes 5
The rule now skips fixes for some edge cases.
The rule now fixes only ExpressionStatement and checks the operator.
Improves the RegExp-to-string fix.
Fixes a crash on for..of loops.
The rule's fix for
retValis improved.
eslint-plugin-unicorn 4415 changes
Breaking changes 1
The
prefer-negative-indexrule no longer includesArrayBuffer#at.
New APIs and options 6
Checks
.findLastand.findLastIndex.A new rule is available to flag use of document.cookie.
Adds a rule for detecting unnecessary await expressions.
Adds an option to also prefer
.findLast().Checks
.findLastand.findLastIndex.Adds a rule for enforcing braces around switch cases.
Behavior and default changes 2
Checks
.findLastand.findLastIndex.Checks
.findLast().
Tooling 1
Prefers
.lastIndexOf()over.findLastIndex().
Fixes and other changes 5
Avoids fixing when
.sourceor.toString()is used.Fixes a crash when using the TypeScript parser.
Improves the rule's autofix.
Skips the fix when a variable is a JSX component.
Preserves trailing spaces.
eslint-plugin-unicorn 4315 changes
Breaking changes 2
Node.js 14 is now required.
Always checks
require().
Deprecations 1
Deprecates the import-index rule.
New APIs and options 2
Adds the prefer-event-target rule.
Adds a rule that prefers logical operators over ternary expressions.
Behavior and default changes 5
Checks reassignment in
for..inandfor..ofloops.Checks any use of global functions.
Detects usage via the global object.
Adds prefer-top-level-await to the recommended preset.
Updates abbreviations to support Next.js functions.
Fixes and other changes 5
Improves parameter reassignment detection.
Adds a fix for arrow function bodies.
Fixes an auto-fix that could cause a SyntaxError.
Ignores
ref(undefined)in Vue projects.Ignores JSX
meta[charset="utf-8"].
eslint-plugin-unicorn 4215 changes
New APIs and options 4
Adds a rule to detect unreadable IIFEs.
Adds a rule to detect useless switch cases.
Adds a rule to prefer modern Math APIs.
Adds a rule to prefer native coercion functions.
Behavior and default changes 4
The recommended preset no longer enables this rule.
The rule now checks optional chaining.
Adds dist and dst as recognized abbreviations.
The recommended preset sets this rule to error instead of warn.
Fixes and other changes 7
Adds a fixer for parenthesized calls.
The rule now handles optional chaining.
Correctly handles ChainExpression nodes.
The rule ignores arguments in Function#bind().
Stops checking unknown cases.
The fixer skips changes when comments are present.
Automatically fixes encoding identifiers in fs.readFile() and fs.readFileSync().
eslint-plugin-unicorn 414 changes
Breaking changes 2
Requires ESLint 8.
Removes the auto-fix for arguments.
New APIs and options 1
Adds the text-encoding-identifier-case ESLint rule.
Fixes and other changes 1
Fixes TypeScript compatibility for the prefer-export-from rule.
eslint-plugin-unicorn 4020 changes
Breaking changes 2
The rule no longer offers a fix for onerror.
The rule now checks Jest inline snapshots by default.
New APIs and options 4
Adds the no-thenable rule.
Adds the no-useless-promise-resolve-reject rule.
Adds the prefer-json-parse-buffer rule.
Adds the relative-url-style rule.
Behavior and default changes 8
The rule now ignores $ in filenames.
The rule now ignores primitive wrappers in Array#map().
The rule now ignores pIteration.forEach.
The rule now ignores process.stdin, process.stdout, and process.stderr.
The rule now detects unnecessary Promise.resolve and Promise.reject calls in promise callback functions.
The rule now checks .hasAttribute() and .getAttribute().
The rule now checks .removeAttribute().
The rule now supports import assertions.
Fixes and other changes 6
Fixes name conversion.
Fixes a crash in TypeScript files.
Improves the rule's fix logic.
Improves the rule's automatic fix.
Improves argument type detection.
Improves detection of top-level expressions.
eslint-plugin-unicorn 398 changes
New APIs and options 3
Adds the no-await-expression-member rule.
Adds the prefer-code-point rule.
Adds the ignoreUsedVariables option.
Behavior and default changes 2
Shows the file basename instead of the full path.
Removes the rule from the recommended config; users relying on that config will no longer enable it automatically.
Fixes and other changes 3
Fixes a false positive with triple-slash directives.
Fixes a bug when fixing an export namespace as default.
Ignores .toFixed calls from new expressions.
eslint-plugin-unicorn 385 changes
New APIs and options 2
Adds the no-empty-file rule.
Adds the prefer-export-from rule.
Behavior and default changes 2
Rules now ignore Ramda methods.
The rule now checks optional members.
Fixes and other changes 1
The rule now ignores Boolean only in reasonable places.
eslint-plugin-unicorn 372 changes
Breaking changes 1
Adds support for ESLint 8.
New APIs and options 1
Adds the template-indent rule.
eslint-plugin-unicorn 367 changes
New APIs and options 3
Adds a rule for detecting invalid removeEventListener calls.
Adds a rule for detecting useless fallbacks in spread syntax.
Adds a config that enables all rules except deprecated ones.
Behavior and default changes 2
The rule now uses suggestions for the 'use strict' directive.
The rule now checks String#split(''), helping identify cases where spread should be preferred.
Fixes and other changes 2
Handles cases where the Error constructor is shadowed.
Fixes a false negative involving array constants.
eslint-plugin-unicorn 3524 changes
Breaking changes 3
Removes the greater-than-or-equal option because it enabled a style that no one actually uses.
The rule now enforces new for SharedArrayBuffer and Proxy.
The rule now forbids destructuring.
New APIs and options 3
Adds a rule for detecting useless length checks.
Adds a rule for detecting useless spread operations.
Adds a rule that checks for cases where Object.fromEntries() can be used.
Behavior and default changes 11
The rule now checks WeakRef and FinalizationRegistry.
The rule now ignores jQuery methods.
The rule now ignores mobx-state-tree usage.
The rule now supports Vue SFC.
The rule now allows Object.create(null, …).
The rule now supports Vue SFC.
The rule now checks cases comparing .find() with undefined.
The rule now checks destructuring and uses a suggestion instead of an auto-fix.
The rule now ignores i18n and l10n.
Adds def to the rule's allowed abbreviations.
The rule is now disabled for TypeScript files.
Fixes and other changes 7
Fixes cases without a space after keywords.
The rule's report location is improved.
The rule now handles .0 correctly.
Auto-fixing now uses the original quote.
The rule's event types list is updated.
The rule's auto-fix is improved.
Fixes an edge case in the rule.
eslint-plugin-unicorn 3414 changes
Breaking changes 2
The rule now enforces a lowercased file extension.
The rule now checks only methods from [] and {}.
New APIs and options 4
Adds the no-array-method-this-argument rule.
Adds the prefer-at rule; it is disabled in the recommended preset.
Adds the prefer-top-level-await rule; it is disabled in the recommended preset.
Adds the require-post-message-target-origin rule.
Behavior and default changes 4
The rule now supports AggregateError.
The rule now ignores calls to Set#add(), Map#set(), Array#push(), and Array#unshift().
The rule now ignores .cjs files.
The rule now supports Vue SFC.
Fixes and other changes 4
The rule gives a more helpful error when no conditions are specified.
Fixes a crash on left-hand-side zero index access.
Fixes a missing condition on object literal checks.
The rule's report location is improved.
eslint-plugin-unicorn 3313 changes
Breaking changes 1
Removes the check for [].concat(...array.map(…)).
New APIs and options 4
Adds a rule that prefers Object.hasOwn; it is not enabled in the recommended preset.
Adds a rule that prefers prototype methods.
Adds a rule for requiring a separator argument to Array.join().
Adds a rule for requiring an argument to Number.toFixed().
Behavior and default changes 3
Supports experimental syntax.
Ignores this.size and this.length.
Ignores slice() calls on arrayBuffer, blob, buffer, file, and this.
Tooling 1
Adds suggestions for safely handling non-strings.
Fixes and other changes 4
Ignores known, non-number length properties.
Handles cases with only a return statement inside an if or else branch.
Fixes an incorrect autofix and checks Array.prototype.concat.call.
Improves parentheses handling.
eslint-plugin-unicorn 3214 changes
Breaking changes 3
Support for babel-eslint was dropped; migrate to @babel/eslint-parser.
Support for Node.js v10 was dropped, so users need a newer Node.js version.
The rule no longer adds braces to the default case.
Behavior and default changes 6
The rule now checks Set#size.
The rule now supports autofixing complicated parameters.
The rule now ignores known non-array loop variables.
The autofix now singularizes the variable name.
The rule now supports Array#at().
The rule now supports checking destructured errors.
Fixes and other changes 5
The rule's report position is improved.
The rule provides a better error message.
The rule handles numeric separators, fixes missing parentheses, and improves report location.
The rule now avoids conflicts with no-unreachable.
Shorthand import and export detection is fixed.
eslint-plugin-unicorn 312 changes
New APIs and options 2
Adds the prefer-module rule.
Adds the prefer-node-protocol rule.
eslint-plugin-unicorn 3018 changes
Breaking changes 3
Renames the no-keyword-prefix option blacklist to disallowedPrefixes.
The rule no longer fixes code when the callback parameter has a type annotation.
Renames options for this rule, so existing configurations may need updating.
New APIs and options 2
Adds an ignore option to no-array-push-push.
Adds the prefer-switch rule.
Behavior and default changes 1
The rule now reports array.slice(0).
Fixes and other changes 12
The rule now reports parsing errors.
Fixes the optional MemberExpression check when ecmaVersion is 2019.
Suggestion filenames are now unique.
Improves detection of parameters that can be fixed automatically.
The rule now excludes the second argument of Node.insertBefore().
The rule no longer reports return undefined when the function has a returnType.
The rule now handles parenthesized undefined.
Fixes a crash on parenthesized cases.
The rule excludes React.Children.map().flat().
Fixes some edge cases in the rule.
Uses suggestions instead of fixes when the node has a type annotation.
Adds support for PropertyDefinition.
eslint-plugin-unicorn 295 changes
New APIs and options 2
Adds the
no-static-only-classrule.Adds the
prefer-array-flatrule.
Behavior and default changes 1
Adds an
Array#slice()check.
Fixes and other changes 2
Uses
letif parameters are reassigned.Improves same reference detection.
eslint-plugin-unicorn 2812 changes
Behavior and default changes 4
The rule adds an
ExperimentalRestPropertycheck.The rule ignores
React.Children.forEach.The rule adds an
Array#some()check.The rule ignores
Buffer.concat().
Fixes and other changes 8
The rule handles an unexpected case.
The rule's fix keeps all comments.
The rule no longer crashes on destructuring in a
for…ofloop.The rule handles non-iterable
visitorKeys.The rule improves the location reported for a finding.
The rule's auto-fix is improved.
The rule adds more suggestions for the
.concatfix.The rule's autofix keeps optional chaining.
eslint-plugin-unicorn 2710 changes
New APIs and options 3
Adds the no-array-for-each rule.
Adds the no-array-push-push rule.
Adds the no-this-assignment rule.
Tooling 2
Adds an auto-fix.
Prefers spread syntax over Array#concat().
Fixes and other changes 5
Improves the auto-fix.
Improves suggestions for Array#forEach().
Improves the auto-fix.
Uses a suggestion for unknown arguments.
Fixes a crash on an unexpected selector.
eslint-plugin-unicorn 268 changes
Breaking changes 1
The rule no longer checks String#match().
New APIs and options 4
Adds the consistent-destructuring rule.
Adds the no-new-array rule.
Adds the prefer-array-index-of rule.
Adds the prefer-regexp-test rule.
Behavior and default changes 2
Removes the import-index rule from the recommended preset.
Ignores AwaitExpression except for reduce and reduceRight.
Fixes and other changes 1
Fixes missing parentheses in some cases.
eslint-plugin-unicorn 2516 changes
Breaking changes 12
Renames no-fn-reference-in-iterator to no-array-callback-reference; update any rule configuration that uses the old name.
Renames no-reduce to no-array-reduce; update any rule configuration that uses the old name.
Renames no-array-instanceof to no-instanceof-array; update any rule configuration that uses the old name.
Renames prefer-flat-map to prefer-array-flat-map; update any rule configuration that uses the old name.
Renames prefer-node-append to prefer-dom-node-append; update any rule configuration that uses the old name.
Renames prefer-dataset to prefer-dom-node-dataset; update any rule configuration that uses the old name.
Renames prefer-node-remove to prefer-dom-node-remove; update any rule configuration that uses the old name.
Renames prefer-text-content to prefer-dom-node-text-content; update any rule configuration that uses the old name.
Renames prefer-event-key to prefer-keyboard-event-key; update any rule configuration that uses the old name.
Renames prefer-replace-all to prefer-string-replace-all; update any rule configuration that uses the old name.
Renames prefer-starts-ends-with to prefer-string-starts-ends-with; update any rule configuration that uses the old name.
Renames prefer-trim-start-end to prefer-string-trim-start-end; update any rule configuration that uses the old name.
New APIs and options 2
Adds the prefer-array-some rule.
Adds the prefer-default-parameters rule.
Fixes and other changes 2
The rule now handles more cases, including unsafe LogicalExpressions and Boolean(foo.length).
The rule ignores Object(x) === x and Object(x) !== x.
eslint-plugin-unicorn 2426 changes
Breaking changes 1
Removes auto-fix for new String, new Boolean(), and new Number().
New APIs and options 7
Allows ignoring arrow functions.
Adds a rule for detecting spaces inside empty braces.
Adds a rule for detecting lonely if statements.
Adds a checkArguments option to no-useless-undefined.
Adds a rule for preferring Date.now.
Adds an ignore option to prevent-abbreviations.
Adds var and vars replacements.
Behavior and default changes 5
Rewrites the error-message rule.
Reports only on the for loop head part.
Excludes useRef(null) and React.useRef(null) from the rule.
Adds Infinity support.
Adds the ver → version replacement.
Fixes and other changes 13
Fixes false import styles in reported problem messages.
Fixes a crash with the babel-eslint parser.
Fixes a crash on destructuring require.
Improves the reported problem location.
Improves output when using the TypeScript parser.
Respects declaration kind.
Ignores the toHaveBeenCalledWith method.
Supports the computed key of ClassProperty, MethodDefinition, and Property.
Improves the rule's output.
Improves the prefer-query-selector rule.
Fixes a crash when called without an argument.
Handles the u flag.
Fixes a crash with the TypeScript parser.
eslint-plugin-unicorn 238 changes
Breaking changes 1
Uses 'greater-than' as the default for 'non-zero'.
New APIs and options 4
Checks anonymous functions.
Adds the numeric-separators-style rule.
Adds the prefer-math-trunc rule.
Adds the prefer-ternary rule.
Behavior and default changes 1
Makes the space position more specific.
Fixes and other changes 2
Tracks JSX presence per-function, fixing some false negatives.
Excludes .flat() when its depth is not 1.
eslint-plugin-unicorn 227 changes
New APIs and options 1
Adds the import-style rule.
Behavior and default changes 2
Updates
ecmaVersionto2021.Ignores more index files.
Fixes and other changes 4
Allows
Childrenin the rule.Fixes an error thrown when using rest in object destructuring.
Fixes a false positive when using
@typescript-eslint/parser.Fixes the error message and improves the report location.
eslint-plugin-unicorn 2111 changes
New APIs and options 2
Adds the no-object-as-default-parameter rule.
Adds the prefer-array-find rule.
Behavior and default changes 2
Is no longer enabled by default in the recommended config.
Adds
evas a default replacement forevent.
Fixes and other changes 7
Improves the report location.
Improves the rule message.
Fixes incorrect detection of IIFEs.
Ignores more types.
Ignores
undefineduse in comparison functions.Fixes handling of pipes in regular expressions.
Fixes handling of optional parameters.
eslint-plugin-unicorn 2010 changes
Breaking changes 1
ESLint 7 is now required to use eslint-plugin-unicorn.
New APIs and options 3
Adds the no-reduce rule.
Adds the no-useless-undefined rule.
Adds the prefer-optional-catch-binding rule.
Behavior and default changes 3
The rule now ignores IIFEs.
The rule now ignores arrays that check existence only once.
The rule gains an auto-fix.
Fixes and other changes 3
Fixes a bug with the m flag.
The rule now handles negative length in .substr().
The rule now checks MemberExpression customError.