Перейти к содержимому

noRedundantDefaultExport

Это содержимое пока не доступно на вашем языке.

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

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

This rule warns 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/nursery/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.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

export const foo = 42;
export default 42;