noRedundantDefaultExport
Summary
Section titled “Summary”- Rule available since:
v2.3.14 - Diagnostic Category:
lint/complexity/noRedundantDefaultExport - This rule isn’t recommended, so you need to enable it.
- This rule doesn’t have a fix.
- The default severity of this rule is warning.
How to configure
Section titled “How to configure”{ "linter": { "rules": { "complexity": { "noRedundantDefaultExport": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”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;Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.