如何在 vue-cli 中禁用 ESLint?

如何在 vue-cli 中禁用 ESLint?

问题描述:

如何在使用 vue-cli 生成的项目中禁用 ESlint?

How do I go about disabling ESlint in project generated with vue-cli?

preLoaders: [
  {
    test: /.vue$/,
    loader: 'eslint',
    include: projectRoot,
    exclude: /node_modules/
  },
  {
    test: /.js$/,
    loader: 'eslint',
    include: projectRoot,
    exclude: /node_modules/
  }
]

如果我删除 loader: 'eslint' 行,它将无法编译,与将其设置为空字符串相同.我知道我可以在初始化阶段选择退出 ESLint,但是在我的项目创建后如何禁用它?

If I remove the loader: 'eslint' line it won't compile, same with setting it to an empty string. I know I can opt out of ESLint during the initialization phase, but how can I disable it after my project has been created?

Vue 的入门项目本身就是用模板语言构建的.

Vue's starter projects are themselves built with a templating language.

查看模板({{#lint}} 位)看来您可以删除整个 preLoaders 块.

Looking at the templates (the {{#lint}} bits) it appears you can remove the entire preLoaders block.