vscode es6語法報錯

vscode es6語法報錯

vscode es6語法報錯 ? ?

用VS Code開發(fā)ES6語法的項目,Promise等關(guān)鍵字和語法不識別,報錯。

解決方法:

在項目根目錄下建兩個文件: .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

相關(guān)推薦:《vscode使用教程》?

以上就是

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊7 分享