Skip to content

noRedundantDefaultExport

biome.json
{
"linter": {
"rules": {
"complexity": {
"noRedundantDefaultExport": "error"
}
}
}
}

Checks if a default export exports the same symbol as a named export.

This rule reports when a default export references the same identifier as a named export. Re-exports are out of scope.

export const foo = 42;
export default foo;
code-block.js:2:16 lint/complexity/noRedundantDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Default export exports the same symbol as a named export.

1 │ export const foo = 42;
> 2 │ export default foo;
^^^
3 │

Exporting the same identifier as both a named export and a default export is redundant.

Remove either the default export or the named export to avoid redundancy.

export const foo = 42;
export default 42;