-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set options in package.json ? #2929
Comments
Here's an example of setting {
"jshintConfig": {
"expr": true
}
} Please let us know if that does not work for you--it may be a bug in JSHint. As for documentation, I believe the current explanation is fairly descriptive
|
@jugglinmike IMO it would be good to show examples of each of those options, and in addition the inline config (eg. Is there a way to contribute to documentation? If so I'll add some examples and send a pull request. Or is it pulled from this page in wiki? |
Hi @aubergine10. The docs are maintained here: https://github.com/jshint/jshint.github.io |
Ok, will send a pull request early next week. |
@jugglinmike What are the proper locations for the EDIT: Worked it out, ignore me lol. |
I'm sorry to inform you that i have switched to |
PR inspired by jshint/jshint#2929 Added distinct sections for different ways to apply settings (inline, settings files, CLI), ensuring clear example for each. Removed some excess verbiage so that readers get to details quicker. Applied some formatting for easier reading. Wasn't sure about order of precedence so guessed - lmk if it's wrong.
the way you mentioned doesn't work for me. I tried the comments which I though would be the easiest, but nop. Then I tried the hidden file and also the package.json. How can I configure this JSHint plugin? |
Its 2018 and I still could not get this working. |
It does work. But it is really a shame for such an important VSCode extension not to include a proper example in the documentation… Long story short: You've to place the configuration block alongside the other settings in package.json. Here my version to set the directive for "esversion". The first few lines are set by VSCode at project start. The 2nd section ("jshintConfig") is the block of interest.
|
@toraxmalu should the numbers and booleans also be strings? |
Sorry, no clue. JShint worked as whished with the quoted config. And for me it was a hack without really knowing, what I do. ;) But have a look into JSON-standard. There you should find the answer |
i tried it lol no need for strings, booleans and numbers are fine ^-^ |
The documentation mentions this possibility using
jshintConfig
, but no example or explanations.The text was updated successfully, but these errors were encountered: