Validating JavaScript using ESLint in Visual Studio Code

February 9, 2018

#ESLint #JavaScript #jQuery #JSLint #node.js #SSHFS #Visual Studio Code

ESLint / Visual Studio Code
ESLint highlighting sloppy code

I switched to Microsoft Visual Studio Code originally because Brackets seemed to struggle with remote file systems mounted using via SSHFS (using Fuse for macOS).

Brackets has JSLint built in. Various JavaScript linting options exist for Visual Studio Code. I’m using ESLint and this extension which integrates ESLint into VSCode.

ESLint requires node.js & npm. Install node.js locally using the pkg. The npm package manager is installed as part of that. We then use npm to install ESLint globally (sudo npm install -g eslint).

Then run eslint --init from the root directory of any project where you want to use ESLint to validate the code. That will create a project specific configuration file.

Show All Posts