unicorn/default-export-style
eslint-plugin-unicorn
Safe autofix
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/default-export-style": "error",
},
},
];const foo = () => {};
export default foo;export default function foo() {}class Foo {}
export default Foo;export default function foo() {}const foo = () => {};
export default foo;export default function foo() {}Examples from the ESLint documentation.
unicorn/default-export-style
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/default-export-style": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce consistent conditional object spread style.
Prevent usage of variables from outside the scope of isolated functions.
Enforce consistent class member order.
Require or disallow logical assignment operator shorthand
Enforce consistent class references in static methods.
Enforce replacements for variable, property, and filenames.