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!