简体   繁体   English

如何在 babel config 中设置“no-unused-vars”:“off”?

[英]How to set “no-unused-vars”: “off” in babel config?

I have a vue.js and want to disable the unsed var error.我有一个 vue.js 并想禁用 unsed var 错误。 My babel config looks like this:我的 babel 配置如下所示:

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

Where can add I add custom options?在哪里可以添加我添加自定义选项? I read this doc https://babeljs.io/docs/en/options but can't find it.我读了这个文档https://babeljs.io/docs/en/options但找不到它。

If you are using eslint you can configure rules in your eslint config如果你使用 eslint,你可以在你的 eslint 配置中配置规则

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

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

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

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