unicorn/no-array-reverse
eslint-plugin-unicorn
Suggestion
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-array-reverse": "error",
},
},
];const reversed = [...array].reverse();const reversed = [...array].toReversed();Examples from the ESLint documentation.
unicorn/no-array-reverse
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-array-reverse": "error",
},
},
];unicorn/no-array-reverse
unicorn plugin · suspicious
{
"rules": {
"unicorn/no-array-reverse": "error"
}
}Biome does not have this rule.
Disallow using the this argument in array methods.
Prefer Array#toSorted() over Array#sort().
Disallow using reference values as Array#fill() values.
Disallow the use of objects as default parameters.
Disallow anonymous functions and classes as the default export.
Disallow assigning this to a variable.