【问题标题】:How to use eslint autofix in .vue?如何在 .vue 中使用 eslint 自动修复?
【发布时间】:2017-03-24 03:25:24
【问题描述】:

我想在.vue 文件中使用自动修复,但 Eslint 只显示错误,没有自动修复。

如何配置.eslintrc 使其工作?

【问题讨论】:

    标签: vue.js eslint


    【解决方案1】:

    尝试使用它来指定文件扩展名

    eslint --fix --ext .js,.vue src
    

    【讨论】:

      【解决方案2】:

      它不会起作用。 我有完全相同的问题,并在这里问了这个问题(很惊讶你没有找到它)。 我还在 Github 上问过他们,答案是他们仍然没有提供使用插件修复的解决方案(vue-loader)。

      Eslint and VueJS files. Throwing errors but not fixing them

      这是 Eslint 的 Github 上的帖子:https://github.com/eslint/eslint/issues/7456#issuecomment-256757117

      希望对你有帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-03-20
        • 2020-02-17
        • 2015-12-09
        • 2020-11-03
        • 2017-04-22
        • 1970-01-01
        • 2021-07-13
        • 2017-11-05
        相关资源
        最近更新 更多