vscode 标准库位置_如何在VSCode中使用标准

vscode 标准库位置

I use Visual Studio Code as my text editor. When I write JavaScript, I follow JavaScript Standard Style.There's an easy way to integrate Standard in VS Code—with the vscode-standardjs plugin. I made a video for this some time ago if you're interested in setting it up.But, if you follow the instructions in the video (or on vscode-standardjs's readme file), you'll come to notice there's one small detail that needs to be ironed out.Try writing a function the old way, and save it repeatedly. VS code will toggle between having and not having a space before the left-parenthesis of the function.

我使用Visual Studio Code作为文本编辑器。 在编写JavaScript时,我遵循的是JavaScript标准样式 。有一种简单的方法可以将vs 标准-js插件与VS Code集成。 如果您有兴趣设置视频 ,我前段时间制作了一个视频 。但是,如果您按照视频(或vscode-standardjs的自述文件)中的说明进行操作,您会发现其中有一个小细节需要解决的问题。尝试以旧方式编写function ,然后重复保存。 VS代码将在函数左括号前是否有空格之间切换。

VS code toggles between having and not having a space before '('.

You get the same problem when you write methods with the ES6 method shorthands:

使用ES6方法速记编写方法时,您会遇到相同的问题:

Same problem happens when you create methods with ES6 method shorthands.

There's a quick way to fix this issue. What you need to do is set javascript.format.enable to false. This disables VS Code's default Javascript formatter (and lets vscode-standandjs does the formatting work).

有一种快速解决此问题的方法。 您需要将javascript.format.enable设置为false 。 这将禁用VS Code的默认Javascript格式化程序(并让vscode-standandjs进行格式化工作)。

So the minimum configuration you need to get Standard and VS Code to work together is:

因此,使Standard和VS Code协同工作所需的最低配置为:

{
  // Prevents VS Code from formatting JavaScript with the default linter
  "javascript.format.enable": false,

  // Prevents VS Code linting JavaScript with the default linter
  "javascript.validate.enable": false,

  // Lints with Standard JS
  "standard.enable": true,

  // Format files with Standard whenever you save the file
  "standard.autoFixOnSave": true,

  // Files to validate with Standard JS
  "standard.validate": [
    "javascript",
    "javascriptreact"
  ]
}


This article was originally posted on my blog.Sign up for my newsletter if you want more articles to help you become a better frontend developer.

本文最初发布在我的博客上 如果您想获得更多文章来帮助您成为更好的前端开发人员,请注册我的时事通讯

翻译自: https://www.freecodecamp.org/news/https-zellwk-com-blog-standard-with-vscode/

vscode 标准库位置

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值