no-anonymous-default-export
Added in v0.9.4Configuration
Rule Details
Require a name for default exports of arrays, arrow functions, anonymous function and class declarations, literals, objects, and class instances. Naming these values makes their declarations and imports easier to find.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Named exports and re-exports are allowed. Like upstream, the rule also allows
expressions such as export default -1, export default (class {}), and
export default ({} as Config).
Dynamic imports such as export default import('module') and optional calls such
as export default factory?.() are allowed even when allowCallExpression is
false.
The rule does not provide automatic fixes or suggestions.
Options
Each option allows its corresponding default export when set to true.
allowCallExpression defaults to true for compatibility with upstream. With
{ "allowCallExpression": false }, assign the call result to a variable before
exporting it: