unicorn/no-array-from-fill
eslint-plugin-unicorn
No autofix
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-array-from-fill": "error",
},
},
];Array.from({length: 3}).fill().map((_, index) => index);Array.from({length: 3}).fill({});Array.from({length: 3}, (_, index) => index);Array.from({length: 3}, () => ({}));Examples from the ESLint documentation.
unicorn/no-array-from-fill
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-array-from-fill": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Add expiration conditions to TODO comments.
Disallow asynchronous callbacks in synchronous iterator helpers.
Enforce consistent style for DOM element dataset access.
Enforce consistent optional chaining for same-base member access.
Disallow chained comparisons such as a < b < c.