Skip to content

noUselessReExportAll (JavaScript)

Language JavaScript (and super languages)
biome.json
{
"linter": {
"rules": {
"nursery": {
"noUselessReExportAll": "error"
}
}
}
}

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.

foo.js
export default function foo() {}
index.js
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.

foo.js
export default function foo() {}
export function bar() {}
index.js
export * from "./foo.js";
export { default } from "./foo.js";
  • To report names that more than one export * from statement exports, see noDuplicateExports.