Unicorn
223 rules eslint-plugin-unicorn@76.0.0
Complete effective rule inventory.
Rules
No enabled Unicorn rules match this search.
-
unicorn/class-reference-in-static-methodsEnforce consistent class references in static methods.
: error in All Unicorn contexts -
unicorn/consistent-assertEnforce consistent assertion style with
node:assert.: error in All Unicorn contexts -
unicorn/consistent-date-clonePrefer passing
Datedirectly to the constructor when cloning.: error in All Unicorn contexts -
unicorn/consistent-empty-array-spreadPrefer consistent types when spreading a ternary in an array literal.
: error in All Unicorn contexts -
unicorn/consistent-function-scopingMove function definitions to the highest possible scope.
: error in TypeScript source, React source, JavaScript source, React JavaScript source, Syntax-only tool configuration, Design-system React source -
unicorn/consistent-json-file-readEnforce consistent JSON file reads before
JSON.parse().: error in All Unicorn contexts -
unicorn/custom-error-definitionEnforce correct
Errorsubclassing.: warning in All Unicorn contexts -
unicorn/error-messageEnforce passing a
messagevalue when creating a built-in error.: error in All Unicorn contexts -
unicorn/explicit-timer-delayEnforce or disallow explicit
delayargument forsetTimeout()andsetInterval().: error in All Unicorn contexts -
unicorn/filename-caseEnforce a case style for filenames and directory names.
: error in All Unicorn contexts -
unicorn/iteration-fallback-styleEnforce a consistent style for optional loop sources.
: warning in All Unicorn contexts -
unicorn/logical-assignment-operatorsRequire or disallow logical assignment operator shorthand
: warning in All Unicorn contexts -
unicorn/new-for-builtinsEnforce correct use of
newfor builtin constructors.: error in All Unicorn contexts -
unicorn/no-accessor-recursionDisallow recursive access to
thiswithin getters and setters.: error in All Unicorn contexts -
unicorn/no-accidental-bitwise-operatorDisallow bitwise operators where a logical operator was likely intended.
: error in All Unicorn contexts -
unicorn/no-array-concat-in-loopDisallow array accumulation with
Array#concat()in loops.: error in All Unicorn contexts -
unicorn/no-array-fill-with-reference-typeDisallow using reference values as
Array#fill()values.: error in All Unicorn contexts -
unicorn/no-array-from-fillDisallow
.fill()afterArray.from({length: …}).: error in All Unicorn contexts -
unicorn/no-array-method-this-argumentDisallow using the
thisargument in array methods.: error in All Unicorn contexts -
unicorn/no-array-reversePrefer
Array#toReversed()overArray#reverse().: error in All Unicorn contexts -
unicorn/no-array-sortPrefer
Array#toSorted()overArray#sort().: error in All Unicorn contexts -
unicorn/no-array-sort-for-min-maxDisallow sorting arrays to get the minimum or maximum value.
: error in All Unicorn contexts -
unicorn/no-async-iterator-callbackDisallow asynchronous callbacks in synchronous iterator helpers.
: error in All Unicorn contexts -
unicorn/no-async-promise-finallyDisallow async functions as
Promise#finally()callbacks.: error in All Unicorn contexts -
unicorn/no-await-expression-memberDisallow member access from await expression.
: error in All Unicorn contexts -
unicorn/no-await-in-promise-methodsDisallow using
awaitinPromisemethod parameters.: error in All Unicorn contexts -
unicorn/no-blob-to-fileDisallow unnecessary
BlobtoFileconversion.: error in All Unicorn contexts -
unicorn/no-boolean-sort-comparatorDisallow boolean-returning sort comparators.
: error in All Unicorn contexts -
unicorn/no-canvas-to-imagePrefer drawing canvases directly instead of converting them to images.
: error in All Unicorn contexts -
unicorn/no-chained-comparisonDisallow chained comparisons such as
a < b < c.: error in All Unicorn contexts -
unicorn/no-collection-bracket-accessDisallow accessing
Map,Set,WeakMap, andWeakSetentries with bracket notation.: error in All Unicorn contexts -
unicorn/no-computed-property-existence-checkDisallow dynamic object property existence checks.
: warning in All Unicorn contexts -
unicorn/no-confusing-array-spliceDisallow confusing uses of
Array#{splice,toSpliced}().: error in All Unicorn contexts -
unicorn/no-confusing-array-withDisallow confusing uses of
Array#with().: error in All Unicorn contexts -
unicorn/no-constant-zero-expressionDisallow arithmetic and bitwise operations that always evaluate to
0.: error in All Unicorn contexts -
unicorn/no-document-cookieDo not use
document.cookiedirectly.: error in All Unicorn contexts -
unicorn/no-double-comparisonDisallow two comparisons of the same operands that can be combined into one.
: error in All Unicorn contexts -
unicorn/no-duplicate-if-branchesDisallow duplicate adjacent branches in if chains.
: error in All Unicorn contexts -
unicorn/no-duplicate-logical-operandsDisallow adjacent duplicate operands in logical expressions.
: error in All Unicorn contexts -
unicorn/no-duplicate-loopsDisallow
.map()and.filter()infor…ofandfor await…ofloop headers.: error in All Unicorn contexts