noReExportAll
诊断类别:lint/performance/noReExportAll
¥Diagnostic Category: lint/performance/noReExportAll
自从:v1.6.0
来源:
¥Since: v1.6.0
Sources:
-
与以下相同:
barrel-files/avoid-re-export-all
¥Same as:
barrel-files/avoid-re-export-all
避免重新导出所有内容。
¥Avoid re-export all.
模块化项目中深度嵌套的导入链(即一个 barrel 文件导入另一个 barrel 文件)会导致加载时间和复杂性增加。此结构导致许多模块不必要地加载,严重影响大型应用的性能。此外,它使代码库复杂化,使得导航和理解项目的依赖图变得困难。
¥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
¥Invalid
code-block.js:1:8 lint/performance/noReExportAll ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Do not use export all ( export * from … ).
> 1 │ export * from “foo”;
│ ^^^^^^^^^^^^^
2 │
ℹ Use named export instead.
code-block.js:1:8 lint/performance/noReExportAll ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Do not use export all ( export * from … ).
> 1 │ export * as foo from “foo”;
│ ^^^^^^^^^^^^^^^^^^^^
2 │
ℹ Use named export instead.
¥Valid
¥Related links