In search of a better IDE for node development, we are going to try “Visual Studio Code”. We are not sure why MS is developing free tools for open source platforms, but cant complain. We only hope they don’t drop developing it if there is no money in it.
Here is the list of steps to setup the environment we use:
- Download visual studio code from here
- Click on the extensions icon on the left, and add the following plugins:
- There are probably more, but we haven’t find anything else worth installing yet.
- Get rid of the activity bar. Right click on it and select “Hide activity bar”. It would be more useful if this bar had things like “Save”.
- Install and configure eslint. Sadly, the plugin doesn’t do this for you, and the instructions it gives are incorrect. It also failed to find my exising eslint installation and configuration files, I had to start again.
- open a cmd prompt and navigate to your node project directory.
- type: “npm install eslint –save-dev. This gives warnings “no repository field”, which can be ignored.
- type: “node_modules\.bin\eslint –init”
- Follow the instructions using the up/down arrows and enter key.
- You will also have to create a project package file if you have not already.
Visual Studio Code is not perfect.
- There is no save icon, you have to tediously open the file menu if you are a mouse oriented user.
- The autosave option is great, but, unlike intellij, there is no local history feature to get back that file you just accidently saved with the wrong edits. This makes autosave very dangerous. Sadly, the windows file history (which can save every 15 minutes) only works with an external drive. It would be fantastic if it could work with an internal drive instead, just to save local changes.
- It doesn’t support SVN. I am sure that git is great for distributed projects with push/pull, but you cant beat SVN for simplicity and convenience of many components in one place.
- It doesn’t really have the concept of a project. However, you can open your node folder, which is similar.
- Getting the eslint plugin is non trivial. Eclipse + node plugin is much better in this regard.
- Settings have to be handed edited. With notepad++, its all UI based, checkboxes, dropdowns etc. The problem is if you want to change something, you have to read the manual. e.g. by default “hotExit” is enabled. This is a disaster for me as I have two machines, one at home and one in the office. All my files are on oneDrive, so I can simply carry on where I left off when I go to/from work. But with hotExit, it doesnt ask me to save any edited files when you exit VSC. The setting is as follows “files.hotExit”: “onExit”. The problem is, there is no comment or hint at how to switch this off, Even google cant help.
Each edit has different strengths and weaknesses. All are flawed. The ultimate IDE would have the simplicity and power of notepad++ editor, the code completion VCS, and the auto-save with local history of intellij and everything else from eclipse (multi-project handling, UI, rich plugins, painless jslint integration etc)