【问题标题】:ES6 support in VSCode isnt workingVSCode 中的 ES6 支持不起作用
【发布时间】:2016-04-30 21:41:03
【问题描述】:

我已经看到有关此问题的其他问题 - Is there a way to turn on ES6/ES7 syntax support in vscode? - 但微软和 implemented in VSCode 现在已经解决了这个问题。

但是,我已经下载了最新版本的 VSCode,并从GitHub 克隆了示例 es6 repo,但似乎无法正常工作

【问题讨论】:

  • 你仍然需要在你的 jsconfig.json 中定位 ES6。
  • 我有那个文件,它在我克隆的示例仓库中,并在我发布的图片中打开

标签: javascript ecmascript-6 visual-studio-code


【解决方案1】:

要启用 ES6/ES7 支持,最好的方法是使用带有专用解析器(babel 等)的 ESLint。如果你有兴趣,我试试看:VSCode Linter ES6 ES7 Babel linter

【讨论】:

    【解决方案2】:

    如果您在 npm 中使用 eslint,您可能需要项目根文件夹中的 .eslintrc 文件。请参阅我的回答 to this questionESLint VSCode extension 的文档。

    【讨论】:

      猜你喜欢
      • 2018-06-29
      • 1970-01-01
      • 1970-01-01
      • 2022-12-19
      • 2018-09-08
      • 2018-05-11
      • 2015-04-12
      • 1970-01-01
      • 2015-02-10
      相关资源
      最近更新 更多