Home  >  Article  >  Development Tools  >  vscode es6 syntax error

vscode es6 syntax error

angryTom
angryTomOriginal
2019-11-07 14:54:413837browse

vscode es6 syntax error

vscode es6 syntax error

Use VS Code to develop ES6 syntax projects, Promise and other keywords and syntax are not correct Identify and report errors.

Solution:

Create two files in the project root directory: .eslintrc.js .eslintignore

.eslintrc.js

// http://eslint.org/docs/user-guide/configuringmodule.exports = {
  root: true,
  parser: 'babel-eslint',
  parserOptions: {
    sourceType: 'module'
  },
  env: {
    browser: true,
  },
  // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
  extends: 'standard',
  // required to lint *.vue files
  plugins: [
    'html'
  ],
  // add your custom rules here
  'rules': {
    // allow paren-less arrow functions
    'arrow-parens': 0,
    // allow async-await
    'generator-star-spacing': 0,
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
  }}

.eslintignore

build/*.js
config/*.js

Related recommendations: "vscode Usage Tutorial"

The above is the detailed content of vscode es6 syntax error. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to use vscode debugNext article:How to use vscode debug