Skip to content
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

Linting ignored files triggers a warning #22

Closed
mgol opened this issue May 21, 2014 · 9 comments
Closed

Linting ignored files triggers a warning #22

mgol opened this issue May 21, 2014 · 9 comments

Comments

@mgol
Copy link

mgol commented May 21, 2014

See eslint/eslint#905 for the description of the problem & discussion around it.

Basically, if you want to have filest passed to the eslint task usable for usage with grunt-newer, you need to pass files, not directories. But if you pass files and some of them are in .eslintignore, ESLint triggers a warning. This can seriously flood the console with warnings not applicable here; it's enough to e.g. pass app/**/*.js to the eslint task and have app/vendor/** in .eslintignore.

@nzakas proposed to add the --silent option to ignore warnings which would make this issue disappear but would also make all other warnings disappear.

Do you have a better idea how to solve this problem? Input welcome!

@sindresorhus
Copy link
Owner

The solution is for ESLint to have a real programmatic API so I don't have to use the CLI interface.

It should just accept and array of file paths (not directories!) and options and have events for different things like warnings. That way we consumer can decide what to show.

@nzakas
Copy link

nzakas commented May 24, 2014

If you have a proposal for what such an API would look like, please file an
issue. I'm doing a lot of refactoring so now would be the best time to
chime in.

@sindresorhus
Copy link
Owner

@nzakas done: eslint/eslint#935

@mgol
Copy link
Author

mgol commented Jul 8, 2014

@sindresorhus Now that eslint/eslint#935 is resolved (and ESLint 0.7.1 released), this issue should be solvable, right?

@nzakas
Copy link

nzakas commented Jul 9, 2014

This API isn't exposed publicly yet, it will be in 0.8.0.​

@pigulla
Copy link

pigulla commented Jan 22, 2015

Any updates on this?

@nzakas
Copy link

nzakas commented Jan 22, 2015

The API has been available in ESLint for a while now. https://eslint.org/docs/developer-guide/nodejs-api.html

@sindresorhus
Copy link
Owner

@pigulla #34 (comment)

@ratherblue
Copy link

Did a flag for this specific functionality ever get added? gulp-eslint has warnFileIgnored but I didn't see a similar option for grunt-eslint. The ignored files are still showing up as warnings when I test this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants