如何在 vue-cli 3 上禁用 eslint? [英] How to disable eslint on vue-cli 3?
问题描述
我最近更新了最新版本 vue-cli 3
I recently update the laster version vue-cli 3
创建项目并运行后,它将显示消息
After creating a project and run it, it will show the message
- 您可以使用特殊注释来禁用某些警告.
- 使用
//eslint-disable-next-line
忽略下一行. - 使用
/* eslint-disable */
忽略文件中的所有警告.
- You may use special comments to disable some warnings.
- Use
//eslint-disable-next-line
to ignore the next line. - Use
/* eslint-disable */
to ignore all warnings in a file.
但是我应该将这些评论放在哪个文件中?
but in Which file should I put those comments?
我的根文件夹中只有 package.json/package-lock.json 和 .gitignore
I only have a package.json / package-lock.json and .gitignore on my root folder
我必须创建一个 .eslintrc 吗?
Do I have to create a .eslintrc?
推荐答案
你可以通过在你的项目中添加一个 vue.config.js
文件来移除 eslint
规则以下内容.
You can remove the eslint
rule by adding a vue.config.js
file to your project with the following content.
module.exports = {
chainWebpack: config => {
config.module.rules.delete('eslint');
}
}
或者,如果您的项目有 config\index.js
文件,您可以通过添加以下行来禁用 eslint.
Alternatively if your project has a config\index.js
file you can disable eslint by adding the following line.
useEslint: false,
这篇关于如何在 vue-cli 3 上禁用 eslint?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!