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

Expose `loadConfig` from CLI for use from external tools #741

Closed
dpashkevich opened this Issue Nov 14, 2012 · 6 comments

Comments

Projects
None yet
6 participants
@dpashkevich

dpashkevich commented Nov 14, 2012

Currently only the CLI version of JSHint loads the .jshintrc file.

It would be nice if the config file would still be respected when jshint is used from tools like Grunt.
If loadConfig function was exposed, that would be possible.

And I can't just use grunt.file.readJSON() because .jshintrc isn't strictly a JSON file since it may contain comments (which I think is a great idea).

Please see related discussion here: gruntjs/grunt-contrib-jshint#2

@mhulse

This comment has been minimized.

Show comment
Hide comment
@mhulse

mhulse Feb 15, 2013

+1 for this idea.

mhulse commented Feb 15, 2013

+1 for this idea.

@doberkofler

This comment has been minimized.

Show comment
Hide comment
@doberkofler

doberkofler commented Feb 15, 2013

+1

xzyfer added a commit to xzyfer/jshint that referenced this issue Mar 22, 2013

Fixes jshint#693 and jshint#741. Export `gather` for easier extensibi…
…lity.

This path adds `gather(opts)` to the cli export which the intention of
allowing third parties to hook into the file resolution, including file
ignore logic.

`cli.gather` is only concerned with the follow opts:
- cli args (files to linted)
- ignores (as would be parse from .jshintignores)
- extensions (as would be supplied by --extra-ext cli flag)

Called these, it will return an array of file paths that should be linted.

xzyfer added a commit to xzyfer/jshint that referenced this issue Mar 22, 2013

Fixes jshint#693 and jshint#741. Export `gather` for easier extensibi…
…lity.

This patch adds `gather(opts)` to the cli export with the intention of
allowing third parties to hook into the file resolution, including file
ignore, logic.

`cli.gather` is only concerned with the following opts:
- cli args (files to linted)
- ignores (as would be parse from .jshintignores)
- extensions (as would be supplied by --extra-ext cli flag)

It would return an array of file paths that should be linted.

xzyfer added a commit to xzyfer/jshint that referenced this issue Mar 25, 2013

Fixes jshint#693 and jshint#741. Export `gather` for easier extensibi…
…lity.

This patch adds `gather(opts)` to the cli export with the intention of
allowing third parties to hook into the file resolution, including file
ignore, logic.

`cli.gather` is only concerned with the following opts:
- cli args (files to linted)
- ignores (as would be parse from .jshintignores)
- extensions (as would be supplied by --extra-ext cli flag)

It would return an array of file paths that should be linted.
@OliverJAsh

This comment has been minimized.

Show comment
Hide comment
@OliverJAsh

OliverJAsh commented May 29, 2013

+1

@Krinkle

This comment has been minimized.

Show comment
Hide comment
@Krinkle

Krinkle commented May 30, 2013

This has been fixed in 11a3a8e and is now available in the 2.x release:

@Krinkle

This comment has been minimized.

Show comment
Hide comment
@Krinkle

Krinkle May 30, 2013

Nevermind, loadConfig is still not exposed.

Krinkle commented May 30, 2013

Nevermind, loadConfig is still not exposed.

@valueof valueof closed this in 28dae4b Jul 1, 2013

jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

Fixes jshint#693 and jshint#741. Export `gather` for easier extensibi…
…lity.

This patch adds `gather(opts)` to the cli export with the intention of
allowing third parties to hook into the file resolution, including file
ignore, logic.

`cli.gather` is only concerned with the following opts:
- cli args (files to linted)
- ignores (as would be parse from .jshintignores)
- extensions (as would be supplied by --extra-ext cli flag)

It would return an array of file paths that should be linted.

jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

@FagnerMartinsBrack

This comment has been minimized.

Show comment
Hide comment
@FagnerMartinsBrack

FagnerMartinsBrack Dec 22, 2016

... .jshintrc isn't strictly a JSON file since it may contain comments (which I think is a great idea).

Is this publicly documented somewhere? I just want to make sure using comments in my .jshintrc files won't have side-effects in the future and it will be mentioned in changelog if something is changed.

See js-cookie/js-cookie#288 (comment).

FagnerMartinsBrack commented Dec 22, 2016

... .jshintrc isn't strictly a JSON file since it may contain comments (which I think is a great idea).

Is this publicly documented somewhere? I just want to make sure using comments in my .jshintrc files won't have side-effects in the future and it will be mentioned in changelog if something is changed.

See js-cookie/js-cookie#288 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment