Unicorn
86 rules oxlint@1.91.0
Complete effective rule inventory.
Rules
No enabled Unicorn rules match this search.
-
unicorn/no-unnecessary-array-splice-countDisallow using
.lengthorInfinityas thedeleteCountorskipCountargument ofArray#{splice,toSpliced}().: error in All Unicorn contexts -
unicorn/no-unnecessary-awaitDisallow awaiting non-promise values.
: error in All Unicorn contexts -
unicorn/no-unnecessary-slice-endDisallow using
.lengthorInfinityas theendargument of{Array,String,TypedArray}#slice().: error in All Unicorn contexts -
unicorn/no-useless-collection-argumentDisallow useless values or fallbacks in
Set,Map,WeakSet, orWeakMap.: error in All Unicorn contexts -
unicorn/no-useless-error-capture-stack-traceDisallow unnecessary
Error.captureStackTrace(…).: error in All Unicorn contexts -
unicorn/no-useless-fallback-in-spreadDisallow useless fallback when spreading in object literals.
: error in All Unicorn contexts -
unicorn/no-useless-iterator-to-arrayDisallow unnecessary
.toArray()on iterators.: error in All Unicorn contexts -
unicorn/no-useless-length-checkDisallow useless array length check.
: error in All Unicorn contexts -
unicorn/no-useless-promise-resolve-rejectDisallow returning/yielding
Promise.resolve/reject()in async functions or promise callbacks: error in All Unicorn contexts -
unicorn/no-useless-spreadDisallow unnecessary spread.
: error in All Unicorn contexts -
unicorn/prefer-add-event-listenerPrefer
.addEventListener()and.removeEventListener()overon-functions.: error in All Unicorn contexts -
unicorn/prefer-array-flatPrefer
Array#flat()over legacy techniques to flatten arrays.: error in All Unicorn contexts -
unicorn/prefer-array-flat-mapPrefer
.flatMap(…)over.map(…).flat()and.filter(…).flatMap(…).: error in All Unicorn contexts -
unicorn/prefer-array-index-ofPrefer
Array#{indexOf,lastIndexOf}()overArray#{findIndex,findLastIndex}()when looking for the index of an item.: error in All Unicorn contexts -
unicorn/prefer-array-somePrefer
.some(…)over.filter(…).lengthcheck and.{find,findLast,findIndex,findLastIndex}(…).: error in All Unicorn contexts -
unicorn/prefer-atPrefer
.at()method for index access andString#charAt().: error in All Unicorn contexts -
unicorn/prefer-bigint-literalsPrefer
BigIntliterals over the constructor.: error in All Unicorn contexts -
unicorn/prefer-blob-reading-methodsPrefer
Blob#arrayBuffer()overFileReader#readAsArrayBuffer(…)andBlob#text()overFileReader#readAsText(…).: error in All Unicorn contexts -
unicorn/prefer-class-fieldsPrefer class field declarations over
thisassignments in constructors.: error in All Unicorn contexts -
unicorn/prefer-code-pointPrefer
String#codePointAt(…)overString#charCodeAt(…)andString.fromCodePoint(…)overString.fromCharCode(…).: error in All Unicorn contexts -
unicorn/prefer-date-nowPrefer
Date.now()to get the number of milliseconds since the Unix Epoch.: error in All Unicorn contexts -
unicorn/prefer-default-parametersPrefer default parameters and destructuring defaults over reassignment and fallback expressions.
: error in All Unicorn contexts -
unicorn/prefer-event-targetPrefer
EventTargetoverEventEmitter.: error in All Unicorn contexts -
unicorn/prefer-export-fromPrefer
export…fromwhen re-exporting.: error in All Unicorn contexts -
unicorn/prefer-import-meta-propertiesPrefer
import.meta.{dirname,filename}over legacy techniques for getting file paths.: error in All Unicorn contexts -
unicorn/prefer-keyboard-event-keyPrefer
KeyboardEvent#keyover deprecated keyboard event properties.: error in All Unicorn contexts -
unicorn/prefer-math-min-maxPrefer
Math.min()andMath.max()over ternaries for simple comparisons.: error in All Unicorn contexts -
unicorn/prefer-math-truncPrefer
Math.trunc()for truncating numbers.: error in All Unicorn contexts -
unicorn/prefer-modern-math-apisPrefer modern
MathAPIs over legacy patterns.: error in All Unicorn contexts -
unicorn/prefer-modulePrefer JavaScript modules (ESM) over CommonJS.
: error in All Unicorn contexts -
unicorn/prefer-native-coercion-functionsPrefer using
String,Number,BigInt,Boolean, andSymboldirectly.: error in All Unicorn contexts -
unicorn/prefer-negative-indexPrefer negative index over
.length - indexwhen possible.: error in All Unicorn contexts