【问题标题】:Automatically fix lint problems only on a specific file仅在特定文件上自动修复 lint 问题
【发布时间】:2018-12-15 05:40:11
【问题描述】:

我正在从命令行运行 npm run lint -- --fix 以自动修复 lint 错误,但此命令会在整个项目上创建修复程序。

我一直在搜索documentation 以了解如何在特定文件而不是整个项目上运行自动修复,但我找不到方法。

这可能吗?

【问题讨论】:

    标签: npm command-line eslint


    【解决方案1】:

    使用 CLI 中的 ESLint 应该可以修复它:

    eslint --fix "C:\code\hello-world.js"
    

    ESLint CLI documentation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-25
      • 2021-09-09
      • 2021-03-06
      • 2022-01-02
      • 1970-01-01
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多