microsoft / vscode-jshint

VSCode extension to integrate jshint into VSCode
https://marketplace.visualstudio.com/items?itemName=dbaeumer.jshint
MIT License
72 stars 58 forks source link

Documentation for how to use compared to 'built in' linting #8

Closed cfjedimaster closed 8 years ago

cfjedimaster commented 8 years ago

This may fall into the main VSCode area and not this extension, but I think it needs explaining.

So - before VSC adding extensions, I had used a few properties in my user prefs to define how I wanted linting done. So I currently have this:

"javascript.validate.lint.comparisonOperatorsNotStrict": "error", "javascript.validate.lint.missingSemicolon": "error", "javascript.validate.lint.unusedVariables": "warning",

"javascript.validate.lint.unusedFunctions": "warning",

I installed the JSHint extension and it added:

"jshint.enable": true,

So my first question is: Are the previous items no longer necessary? Does VSC use whatever linter is the default (JSLint I believe) and your extension, or just the one?

Secondly (and I apologize for putting more than one thing in a bug, but I feel like it is all related, and I can split this up if needed), I then modified my options like so:

"jshint.options": {
    "strict":false
}

so I'd stop getting 'use strict' errors, but it did not work. So what did I do wrong?

cfjedimaster commented 8 years ago

Ok, so I apologize - I see on this page: https://code.visualstudio.com/docs/languages/javascript#_javascript-linters-eslint-jshint

that they now tell you how to disable the built in linter. I think the docs for the jshint extension should repeat this, just to make it obvious.

However - I still can't get my options to work.

cfjedimaster commented 8 years ago

Using a .jshintrc in my project made it work - but the options thing should have set an editor wide default, right?

cfjedimaster commented 8 years ago

And another related issue. I had x==y and VSC did not report the issue even though eqeqeq should be true by default. It only reported it when I added it to my .jshintrc. Are defaults not being picked up?

egamma commented 8 years ago

@gregvanl can you please cover this in the docs:

that they now tell you how to disable the built in linter. I think the docs for the jshint extension should repeat this, just to make it obvious.

HookyQR commented 8 years ago

@cfjedimaster jshint options are all off (or false) by default. If you want to see what an option does when turned on (note that turning some of them on makes it stop doing something) checkout the JSHint Options page.

cfjedimaster commented 8 years ago

Ok, fair enough. I thought JSHint had default options, but I'm not seeing documentation (on their side) to back that up.

On Sat, Dec 19, 2015 at 7:43 PM, HookyQR notifications@github.com wrote:

@cfjedimaster https://github.com/cfjedimaster jshint options are all off(or false) by default. If you want to see what an option does when turned on (note that turning some of them on makes it stop doing something) checkout the JSHint Options http://jshint.com/docs/options/ page.

— Reply to this email directly or view it on GitHub https://github.com/Microsoft/vscode-jshint/issues/8#issuecomment-166051732 .

Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: raymondcamden