EJS-Lint
EJS-Lint copied to clipboard
add --ignore, --ignorefile options to CLI
This adds a --ignore option, as well as an --ignore-file option. The patterns from the CLI input and loaded from the --ignore-file files passed from the CLI are merged and passed to globbySync's ignore option. If it exists, .ejslintignore is loaded automatically.
Sorry, somehow this slipped through the cracks and I didn't get to reviewing until now. This PR adds 3 ways to ignore:
- The
--ignoreoption, which allows multiple patterns - The
--ignore-fileoption, which accepts a file path - The
.ejslintignorefile
I'm not sure if I want all the added complexity of these 3 options. Additionally, I can see a few problems with the current implementations:
-
--ignoreis implemented as an array; though your help message is useful, I can already imagine all the spurious bug reports this will generate when people try to doejslint --ignore ignore.ejs *.ejs - Adding support for
.ejslintignoreis technically a breaking change. Additionally, as currently implemented, it only looks for it in the cwd; one would expect a full recursive filesystem search. However, that's complex to implement.
Accordingly, I'd suggest the following changes:
- Make
--ignorea string. If you have multiple ignore patterns, you can use--ignore-file. - Remove
.eslintignoresupport; anyone who wants it can simply run--ignore-file .eslintignore.
That said, I'm open to feedback if you disagree.