How to disable ESLint in vue-cli?

前端 未结 13 1009
灰色年华
灰色年华 2020-12-02 09:28

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

preLoaders: [
  {
    test: /\\.vue$/,
    loader: \'eslint\         


        
相关标签:
13条回答
  • 2020-12-02 10:05

    There's a hell lot of solutions here: https://github.com/vuejs-templates/webpack/issues/73

    However the best one is :
    To add a line of **/* to .eslintignore, which will ignore all files. And then re-run, if it's a web app!

    0 讨论(0)
  • 2020-12-02 10:05

    setEslint: false work for me!

    module.exports = {
      dev: {
         ...
        // Use Eslint Loader?
        // If true, your code will be linted during bundling and
        // linting errors and warnings will be shown in the console.
        useEslint: false,
        ...
      },
    }
    
    0 讨论(0)
  • 2020-12-02 10:07

    One of the most simple way is just setting an .eslintignore file with you want to disabled folders & files.

    demo

    /build/
    /config/
    /dist/
    /*.js
    /test/unit/coverage/
    
    /000-xyz/
    
    

    Ref: https://github.com/vuejs-templates/webpack/issues/73#issuecomment-355149342

    0 讨论(0)
  • 2020-12-02 10:08

    As of 2019, March :

    In the vue.config.js :

    module.exports = {
      ...
      lintOnSave: false
      ...
    }
    
    0 讨论(0)
  • 2020-12-02 10:12

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

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

    0 讨论(0)
  • 2020-12-02 10:14

    In the latest version, open the ".eslintrc.js" file, and set "root: false".

    0 讨论(0)
提交回复
热议问题