Lint Javascript On Windows With Brackets
lint JavaScript on Windows with Brackets
Akbar S. Ahmed | May 1, 2014

Step-by-step instructions

Adobe Brackets is a cool open source web development editor. Brackets currently works on Mac, Windows and Linux.

Install the JSHint extension

  1. Open Brackets.
  2. Select File, click Extension manager….
  3. Search for Interactive Linter.
  4. Click the Install button for Interactive Linter.

Update your extensions

  1. Open Brackets.
  2. Select Help, click Show Extensions Folder.
  3. Navigate into the \user\interactive-linter folder.
  4. Double-click the .jshintrc file to edit it.
  5. Paste the following into the .jshintrc file. Then save the file and restart Brackets.

This was a quick hack at .jshintrc for Brackets. It likely has some options that you may not need, but the extra options will just be ignored if you don’t need them.

{
    "browser": true,      // Browser globals: e.g. window, document
    "bitwise": false,     // Prohibit bitwise operators (&, |, ^, etc.)
    "camelcase": true,    // Permit only camelcase for `var` and `object indexes`
    "curly": true,        // Require {} for every new block or scope
    "devel": false,       // Allow development statements e.g. `console.log();`.
    "eqeqeq": true,       // Require triple equals i.e. `===`
    "esnext": false,      // Allow ES.next features e.g. const and let
    "immed": true,        // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
    "indent": 4,          // Specify indentation spacing
    "latedef": false,     // Prohibit variable use before definition. (false b/c we need to hoist callback functions)
    "maxlen": 120,        // Max line length
    "newcap": true,       // Require capitalization of all constructor functions e.g. `new F()`.
    "noarg": true,        // Prohibit use of `arguments.caller` and `arguments.callee`.
    "node": true,         // NodeJS globals
    "noempty": true,      // Prohibit use of empty blocks.
    "quotmark": "single", // Define quotes to string values.
    "regexp": true,       // Prohibit `.` and `[^...]` in regular expressions.
    "smarttabs": false,   // Suppresses warnings about mixed tabs and spaces
    "strict": true,       // Require `use strict` pragma in every "file.
    "trailing": true,     // Prohibit trailing whitespaces.
    "undef": true,        // Require all non-global variables be declared before they are used.
    "unused": true,       // Warn unused variables.
    "globals": {          // Globals variables.
        "angular": true,
        "brackets": true,
        "window": true,
        "require": true,
        "define": true,
        "$": true
    },
    "predef": [ // Extra globals.
        "define",
        "exports",
        "module",
        "describe",
        "before",
        "beforeEach",
        "after",
        "afterEach",
        "it",
        "inject",
        "expect",
        "next"
    ]
}



Subscribe to our newsletter

Contact Information

ABOUT EXPONENTIAL.IO

We specialize in helping professional developers, like you, expand your skill set. Our courses are focused on enabling you to learn everything necessary to use a new technology in a live, production application.

LOCATION

All courses are made with love in
Palo Alto, CA.

Subscribe to our newsletter