使用 es6 的 VS 代码 [英] VS Code with es6

查看:26
本文介绍了使用 es6 的 VS 代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码出现 linting 错误 'import' 仅在 ES6 中可用(使用 'esversion: 6').

I am getting the linting error in my code 'import' is only available in ES6 (use 'esversion: 6').

与 es6 相关的所有内容都在抛出错误.不确定我必须配置什么才能让它工作.

Everything es6 related is throwing an error. Not sure what I have to configure to get it to work.

推荐答案

将名为 .jshintrc 的文件添加到您的项目中,并在此文件中键入:

Add a file named .jshintrc to your project and inside this file type this:

{
    "esversion": 6
}

正如你在这里看到的:

jshint 选项的完整文档可以在这里找到:http://jshint.com/docs/options

The full documentation of jshint options are found here: http://jshint.com/docs/options

这篇关于使用 es6 的 VS 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆