Let’s use VS Code!!
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-standard javascript 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-standard javascript'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. VSCode will toggle between having and not having space before the left-parenthesis of the function.
function helloWorld () {
}
vs
function helloWorld() {
}
You get the same problem when you write methods with the ES6 method shorthand,
const greeting = {
sayHello() {
}
vs
const greeting = {
sayHello () {
}
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-standard javascript does the formatting work).