As I continue:
- install globally eslint:
npm install -g eslint - install babel-eslint:
npm install --save-dev babel-eslint - install eslint-plugin-react:
npm install --save-dev eslint-plugin-react - create the
.eslintrc file in the .eslintrc root directory. here is my config:
{ "env": { "browser": true, "node": true, "es6": true, "jest": true, "jquery": true }, "parser": "babel-eslint", "parserOptions": { "ecmaVersion": 6, "sourceType": "module", "ecmaFeatures": { "arrowFunctions": true, "binaryLiterals": true, "blockBindings": true, "classes": true, "defaultParams": true, "destructuring": true, "forOf": true, "generators": true, "modules": true, "objectLiteralComputedProperties": true, "objectLiteralDuplicateProperties": true, "objectLiteralShorthandMethods": true, "objectLiteralShorthandProperties": true, "octalLiterals": true, "regexUFlag": true, "regexYFlag": true, "spread": true, "superInFunctions": true, "templateStrings": true, "unicodeCodePointEscapes": true, "globalReturn": true, "jsx": true, "experimentalObjectRestSpread": true } }, "plugins": [ "react" ], "rules": { "strict": 0 } }
- In VSC, press F1 , then write “extension”, select “install extensions” and then type “eslint” and confirm. you will have to restart VSC
- In the VSC code, open the user parameters (
settings.json ) and write:
{ //disable default javascript validator replaced by eslint "javascript.validate.enable" : false }
Now it should align as your ES7 code wanted. If there is any problem reading the eslint VSC configuration, you can see this in the VSC console ( Ctrl s Shift U ).
As a result, the ES7 code (for example, the distribution operator in objects) is well marked: 
PS: maybe my .eslintrc uses some .eslintrc extra data for ES7 linting, so feel free to delete it :)
Damien Leroux Mar 31 '16 at 7:40 2016-03-31 07:40
source share