noUselessReExportAll (JavaScript)
Language JavaScript (and super languages)
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/noUselessReExportAll - This rule doesn’t have a fix.
- The default severity of this rule is warning.
- This rule belongs to the following domains:
- Sources:
- Inspired from
import/export
- Inspired from
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noUselessReExportAll": "error" } } }}Description
Section titled “Description”Disallow export * from a module that has no named exports.
export * from re-exports the named exports of a module, but not its
default export. When the module has no named exports, the statement
exports nothing.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”export default function foo() {}export * from "./foo.js";/index.js:1:15 lint/nursery/noUselessReExportAll ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ The module ./foo.js has no named exports, so this statement exports nothing.
> 1 │ export * from "./foo.js";
│ ^^^^^^^^^^
2 │
ℹ export * from doesn't re-export the default export.
ℹ Re-export the default export with export { default } from, or remove this statement.
ℹ 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 default function foo() {}export function bar() {}export * from "./foo.js";export { default } from "./foo.js";See Also
Section titled “See Also”- To report names that more than one
export * fromstatement exports, seenoDuplicateExports.
Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.