您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

vscode es6语法报错

2024/3/9 16:27:16发布30次查看
vscode es6语法报错    
用vs code开发es6语法的项目,promise等关键字和语法不识别,报错。
解决方法:
在项目根目录下建两个文件: .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/*.jsconfig/*.js
相关推荐:《vscode使用教程》
以上就是vscode es6语法报错的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product