【问题标题】:ESLint rule for preventing imports that match a pattern用于防止与模式匹配的导入的 ESLint 规则
【发布时间】:2018-10-17 15:11:05
【问题描述】:

有谁知道 ESLint 规则可以标记匹配给定正则表达式的导入?

【问题讨论】:

  • 这将是一个非常容易编写的规则 - 我刚刚检查了 eslint-plugin-import,但它似乎没有你想要的规则。
  • here 是一个快速的解决方案 - 您可以使用 eslint-plugin-local-rules 之类的东西为您的存储库启用它。

标签: javascript eslint


【解决方案1】:

您可以尝试 no-restricted-imports 规则。 no-restricted-imports

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-10
    • 2020-10-26
    • 2021-12-20
    • 2016-06-20
    • 1970-01-01
    • 1970-01-01
    • 2012-07-17
    • 2021-03-07
    相关资源
    最近更新 更多