brackets-jshint icon indicating copy to clipboard operation
brackets-jshint copied to clipboard

Add note to README about suppressing JSLint in Brackets 1.1

Open njx opened this issue 10 years ago • 11 comments
trafficstars

Before Brackets 1.1, I think the JSHint extension automatically suppressed JSLint errors. In 1.1, with the new multiple linter support, JSLint errors started showing up again. It might be good to put a note in your README about adding the proper preference to .brackets.json to re-suppress the JSLint errors:

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

Or maybe there's a way you could set that preference programmatically by default (though you'd have to make sure that the user's own .brackets.json would properly override that).

njx avatar Dec 18 '14 19:12 njx

:+1:

fpirsch avatar Dec 18 '14 20:12 fpirsch

Based on the API of brackets, when you registers a new linting tool, it should suppress the built-in one: " unregisters the built-in Brackets JSLint provider."

http://brackets.io/docs/current/modules/language/CodeInspection.html

The plugin does not call this or it does not work properly?

imrefazekas avatar Dec 19 '14 07:12 imrefazekas

It does not suppress the default provider (JSLint). You have to do it manually. I will update the documentation in the code.

busykai avatar Dec 19 '14 12:12 busykai

@njx thanks for this. I was wondering how to turn JSLint off. :beer:

driskull avatar Dec 20 '14 00:12 driskull

:+1:

tshak avatar Dec 20 '14 20:12 tshak

@njx would this be a bug for Brackets: Open file.js. I see JSLint and JSHint results in the panel. I click the caret to close JSLint results. I select another file. I go back to file.js and the JSLint stuff is expanded again.

cfjedimaster avatar Dec 22 '14 13:12 cfjedimaster

I added a note to the readme.

cfjedimaster avatar Dec 22 '14 13:12 cfjedimaster

This doesn't seem to work on Windows, still getting both JSLint and JSHint warnings.

Update: Never mind, it works. I just needed to wrap it in another set of braces:

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

blah238 avatar Dec 22 '14 20:12 blah238

@njx's code can be pasted in the preference file. You can open it from within Brackets under the Debug menu.

fpirsch avatar Dec 22 '14 21:12 fpirsch

@cfjedimaster: yes, we should remember the state - definitely worth filing.

njx avatar Jan 05 '15 20:01 njx

Done - https://github.com/adobe/brackets/issues/10316

cfjedimaster avatar Jan 05 '15 20:01 cfjedimaster