unicorn/no-instanceof-array
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-instanceof-array": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
Replaced by unicorn/no-instanceof-builtins which covers more cases.
array instanceof Array;
[1,2,3] instanceof Array;Array.isArray(array);
Array.isArray([1,2,3]);Examples from the Oxlint documentation.
unicorn/no-instanceof-array
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-instanceof-array": "error",
},
},
];unicorn/no-instanceof-array
unicorn plugin · pedantic
{
"rules": {
"unicorn/no-instanceof-array": "error"
}
}suspicious/useIsArray
suspicious · since 1.0.0
{
"linter": {
"rules": {
"suspicious": {
"useIsArray": "error"
}
}
}
}Disallow async functions as Promise#finally() callbacks.
Disallow Array#splice() when simpler alternatives exist.
Disallow using the return value of Array#push() and Array#unshift().
Disallow event-control method calls after the synchronous event dispatch has finished.
Disallow accessing event.currentTarget after the synchronous event dispatch has finished.
Disallow .map() and .filter() in for…of and for await…of loop headers.