Top VS Code Settings for Node.js
#1 Auto Save
Commonly Used → Files: Auto Save (select afterDelay)
As we don’t build our code in the traditional sense with Node.js, you can find yourself manually saving a lot. We have all been there where you fire up your app and have forgotten to save a file, so it doesn’t work properly. Never forget again by turning on autosave.
#2 Tab Size
Commonly Used → Editor: Tab Size (set to 2)
If you use a linting rule set, it probably will include a rule about tabs/spaces. If you are like me and use the airbnb rules, then it is going to start moaning about how your space size for tabs is not set to 2.
#3 EOL
Text Editor → Files: Eol (set to \n)
Another one for the airbnb rule set, which expects line endings of LF (Linux) instead of CLRF (Windows). Otherwise, you will have to set the line ending of each file manually (bottom right of the status bar).
#4 Trailing Space
Text Editor → Trim Trailing Whitespace (turn on)
Yet another one for linting. This time, this setting will auto delete trailing spaces at the end of text when a file is saved. This setting along with autosaving means you should never have to worry about it.
#5 Debugging — Inline Values
Features → Debug → Inline Values (turn on)
This is a hidden little gem, which in my mind should be on by default. When turned on you will see the values of all variables in line as you debug.
#6 Cross-Platform Consistency
Window → Title Bar Style (Set to custom)
Writing Node.js means we can do it on any platform. I move between a mac and windows when going to the office and I like to turn on this option so that I can the same experience when using VS Code.
Please share with all your friends on social media and hit that clap button below to spread the word. Leave a response with your favourite setting. 👏
If you liked this post, then please follow me and check out some of my other articles.
About
Matthew Bill is a passionate technical leader and agile enthusiast from the UK. He enjoys disrupting the status quo to bring about transformational change and technical excellence. With a strong technical background (Node.js/.NET), he solves complex problems by using innovative solutions and excels in implementing strong DevOps cultures.
He is an active member of the tech community, writing articles, presenting talks, contributing to open source and co-founding the Norwich Node User Group. If you would like him to speak at one of your conferences or write a piece for your publication, then please get in touch.
Find out more about Matthew and his projects at matthewbill.gihthub.io
Thanks for reading!