Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97327

Correctly setup Eslint Airbnb with VScode in Vue project

$
0
0

This is my Vuejs code without linting.

enter image description here

After I run

npm run lint --fix

Code is like this

enter image description here

But again I do some change and press Control + C. It's get formatted to the old code and gives me back same linting errors.

I think my code is auto formatted when I hit the Control + C.

This is my Vue projects eslint.rc file

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: ['plugin:vue/essential','@vue/airbnb',
  ],
  rules: {'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off','no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  },
  parserOptions: {
    parser: 'babel-eslint',
  },
};

I didn't installed pretier plugin on VScode. But I installed Vueter plugin and Eslint pluggin.

My goal is to format my Vuejs code with Eslint Airbnb rules. When I save the code. Right now it mess the code. How do I fix this?


Viewing all articles
Browse latest Browse all 97327

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>