Is there a way to turn on ES6/ES7 syntax support in vscode?

前端 未结 7 1071
既然无缘
既然无缘 2020-12-02 14:51

Edit 3: Starting in version 0.4.0, ES6 syntax can be turned on by adding a jsconfig.json file to the project folder with the following contents:

7条回答
  •  独厮守ぢ
    2020-12-02 15:49

    As of this date and according to the ESLint docs on the VSCode Marketplace, including a .eslintrc configuration file in the root of the project enables ES6 linting in the ESLint VSCode extension.

    My .eslintrc config file looks like this:

    extends:
      - standard
    parser: babel-eslint
    rules:
      object-curly-spacing: [ error, always ]
      react/prop-types: off
      space-before-function-paren: off
    

    I have eslint installed via npm in node_modules and all I know is that with .eslintrc in the project root folder ES6 linting works and without it, it doesn't.

    Hope this helps...

提交回复
热议问题