【问题标题】:How to set "no-unused-vars": "off" in babel config?如何在 babel 配置中设置“no-unused-vars”:“off”?
【发布时间】:2021-03-05 12:45:39
【问题描述】:

我有一个 vue.js,想禁用 unsed var 错误。我的 babel 配置如下所示:

module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset'
  ]
}

在哪里可以添加自定义选项?我读了这个文档https://babeljs.io/docs/en/options,但找不到它。

【问题讨论】:

    标签: vue.js babeljs


    【解决方案1】:

    如果你使用 eslint,你可以在你的 eslint config 中配置规则

    module.exports = {
        ...
        rules: {
            "no-unused-vars": "off"
        }
    }
    

    https://eslint.org/docs/rules/

    【讨论】:

      猜你喜欢
      • 2021-02-22
      • 2020-03-17
      • 2019-07-06
      • 1970-01-01
      • 2020-03-01
      • 2020-01-25
      • 2021-01-24
      相关资源
      最近更新 更多