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.
nursery/useConsistentDefaultExportStyle
nursery · since 2.6.10
{
"linter": {
"rules": {
"nursery": {
"useConsistentDefaultExportStyle": "error"
}
}
}
}Enforce consistent labels on tuple type elements.
Prevent usage of variables from outside the scope of isolated functions.
Enforce consistent JSON file reads before JSON.parse().
Disallow break and optionally continue in nested loops and switches inside loops.
Enforce consistent naming for boolean names.
Disallow duplicate adjacent branches in if chains.