noReExportAll (not released)
Diagnostic Category: lint/nursery/noReExportAll
Source: avoid-re-export-all
Avoid re-export all.
Deeply nested import chains in modular projects, where a barrel file imports another barrel file, can lead to increased load times and complexity. This structure results in the unnecessary loading of many modules, significantly impacting performance in large-scale applications. Additionally, it complicates the codebase, making it difficult to navigate and understand the project’s dependency graph.
Examples
Section titled ExamplesInvalid
Section titled Invalidexport * from 'foo';
nursery/noReExportAll.js:1:1 lint/nursery/noReExportAll ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Do not use export all ( export * from ... ).
> 1 │ export * from 'foo';
│ ^^^^^^^^^^^^^^^^^^^^
2 │
ℹ Use named export instead.
export * as foo from 'foo';
nursery/noReExportAll.js:1:1 lint/nursery/noReExportAll ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Do not use export all ( export * from ... ).
> 1 │ export * as foo from 'foo';
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │
ℹ Use named export instead.
Valid
Section titled Validexport { foo } from "foo";