简体   繁体   English

禁止在 eslint 中批量导出(export * from)

[英]Forbid bulk export in eslint (export * from)

Is there any way to forbid bulk exports in eslint? eslint 有没有办法禁止批量导出? I want to forbid these exports:我想禁止这些出口:

export * from './module-name';

Can't find appropriate eslint rule.找不到合适的 eslint 规则。

Solution has been found: We need to use the following eslint rule:已经找到解决办法:我们需要使用如下的eslint规则:

{
  "rules": {
    "no-restricted-syntax": ["error", "ExportAllDeclaration"]
  }
}

More details you can find at eslint docs .您可以在eslint 文档中找到更多详细信息。 All available values for the no-restricted-syntax rule can be found here .可以在此处找到no-restricted-syntax规则的所有可用值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM