46

My basic question: In the Adobe Brackets editor how do I use jshint while turning off or disabling jslint?

My tl;dr: When linting javascript in the Adobe Brackets editor I find that I get results for both jslint and jshint. While I have jshint configured to my liking I can never avoid the warning symbol that appears indicating I have failed to pass jslint so it always looks like there are problems with my linting. I only want to use jshint as the ability to globally configure it via the .jshintrc file is quite useful but I don't see a way to turn off jslint and still permit jshint. Anyone know how to do this?

I suppose I could dump jshint and just use jslint but since the latter requires the configuration to be stuck directly in the JS file I don't want to do this.

IceWave
  • 375
  • 3
  • 10
rg88
  • 20,742
  • 18
  • 76
  • 110

5 Answers5

92

You can now add your preferred linters to Brackets' preferences file:

"language": {
    "javascript": {
        "linting.prefer": ["JSHint"],
        "linting.usePreferredOnly": true
    }
},

Open the preferences file with Debug > Open Preferences File.

Brackets preferences
Example preferences.json file

David Lane
  • 1,046
  • 8
  • 5
  • That did the trick! Where did you discover this? I searched everywhere and found not a thing about being able to do this. – rg88 Dec 24 '14 at 02:33
  • 5
    Saw it in the release notes for the latest version. I'm thankful I actually read them now! – David Lane Dec 26 '14 at 17:36
  • 2
    I used **JSHint** and **JSCS** together, so my setting was `"linting.prefer": ["JSHint", "JSCS"]`. – Sithu Feb 14 '15 at 10:41
  • 3
    Just to note the obvious, you also need to install JSHint extension for this to work – quasoft Dec 18 '16 at 14:19
  • What about ESLint? I'm trying with `"linting.prefer": ["ESLint"]` but it seems that it doesn't work – DevStarlight Oct 05 '17 at 10:52
5

To have multiple linters while still disabling jslint use the above plus this:

    "linting.prefer": [
        "JSHint",
        "JSCS"
    ],
Post Impatica
  • 14,999
  • 9
  • 67
  • 78
2

In the Brackets IDE, select File -> Extension Manager. Click the Default tab and look for JSLint in the search box and disable it.

Brackets version - 1.10

Shubhra
  • 21
  • 1
1

1- go to menu-->Debug
2- go to "open Preferences File"
3- go to the file : "brackets.json"
4- copy and pase these codes on last line and dont forget separate code lines with ",":

    "linting.prefer": ["JSHint"],
    "linting.usePreferredOnly": true

*HOPE TO HELP :))

0

So the short answer is "you can't".

After much digging around it seems that while you can turn off jslint, that will also turn off jshint. Since jslint is baked in to Brackets the only solution is to go in and hack the code Brackets yourself. C'est la vie.

rg88
  • 20,742
  • 18
  • 76
  • 110
  • 2
    Obviously my conclusion, which was true at the time I made it, is no longer the case. See David Lane's solution above. – rg88 Feb 06 '15 at 12:26