OHDSI Home | Forums | Wiki | Github

How to ensure you have proper JS linting enabled (JSHint)

All,
I’ve noticed that there have been a few commits into Atlas that seem to be reflecting JSLint rules, but I believe we’re using JSHint based on that the PR related to linting was to include a .jshintrc file (which is a config for JSHint). So, I’m guessing that people aren’t complete set up in brackets to use the correct linter, so I have the instructions here:

It would probably be best to close all windows before doing the following in Brackets:

  1. Get the brackets extensions for JSHint from here: https://github.com/cfjedimaster/brackets-jshint
  2. Clone the repo down to a local directory
  3. Go into Brackets, and go to Help -> Show Extensions Folder
  4. Copy the cloned repo folder (the root folder of the repo) into your extensions folder (should be called brackets-jshint)
  5. Go to Debug->Open Preferences File. You will need to add the following JSON block to the right pane’s file (brackets.json)
 "language": {
  "javascript": {
            "linting.prefer": ["JSHint"],
            "linting.usePreferredOnly": true
        }
    },

Then go to debug->reload with extensions and you should have the JSHint linter enabled.

-Chris

All,
As of Brackets 1.9, you can install the JSHint extension using the Extension Manager (File -> Extension Manager) and search for JSHint. I’ve just verified the extension from Raymond Camden works.

-Chris

t