Home > Development Tools > VSCode > body text

vscode es6 syntax error

angryTom
Release: 2019-11-07 14:54:41
Original
3891 people have browsed it

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
  }}
Copy after login

.eslintignore

build/*.js
config/*.js
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!