Whether to prefer a default export as a named function or a const variable with an arrow function.
It should default to function
style.
It should be auto-fixable.
// "unicorn/default-export-function-style": ["error", "function"]
const foo = () => {};
export default foo;
// "unicorn/default-export-function-style": ["error", "variable"]
export default function foo() {}
// "unicorn/default-export-function-style": ["error", "function"]
export default function foo() {}
// "unicorn/default-export-function-style": ["error", "variable"]
const foo = () => {};
export default foo;
Open question. What should happen to:
export default () => {};
Should we have a separate style for that or just disallow it for both function
and variable
style?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too