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
Ignored files are excluded unless --force is passed on the CLI (fixes #813) #818
Conversation
Yeah, aborting doesn't seem correct. We could provide a warning for each ignored file, pushed onto the front of the messages that are passed to the formatter? |
Yeah, a warning seems to fit nicely. I'll give it a shot. |
Okay, here's an update. Still with no docs or enough tests, but hopefully should be enough to tell whether this is a good interface. An example: assuming a directory with an ignored file called 'foo.js', the console output below shows three scenarios. First, specifying it on the CLI; second, adding the
|
The tests are failing right now firstly because of a linting problem (ironically enough), but then because I didn't update all the formatters to allow for |
@@ -59,6 +59,10 @@ module.exports = optionator({ | |||
type: "[String]", | |||
description: "Specify environments." | |||
}, { | |||
option: "force", | |||
type: "Boolean", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add -f
as a shortcut?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already taken by the shortcut for --formatter
. Any other suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dammit! No, never mind :)
Seems like we may be overloading the meaning of the |
Okay, I'll just change it to be more defensive in checking for the severity. |
Ignored files are reported with a warning Updates logic of formatters to treat non-fatal messages about non-existent rules as warnings. Updates CLI documentation
Anything else you need from me on this one? Apart from the question about a shortcut name for |
LGTM. Sorry for the delay. |
Ignored files are excluded unless --force is passed on the CLI (fixes #813)
This PR implements the suggestion in #813 -- to exclude ignored files passed on the CLI.
To override this behaviour and lint all files passed in regardless of their ignore-state, I've added a flag
--force
.This is still WIP, since there's no documentation of the feature yet, but I didn't want to spend time on that when the interface was not yet agreed upon.
One other thing which I think is missing is some form of alert to users when one or more ignored files were passed in. Without that, it would be quite possible that someone would run
eslint my-ignored-file.js
expecting it to be linted, and receive no errors.As a point of reference, when ignored files are passed to
git add
, it will always exit immediately. I don't think this is useful for eslint though, since the purpose of this feature is to allow a list of files to be passed in and a subset to be linted.