EJS-Lint icon indicating copy to clipboard operation
EJS-Lint copied to clipboard

add --ignore, --ignorefile options to CLI

Open isaac-j-miller opened this issue 2 years ago • 1 comments

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.

isaac-j-miller avatar Oct 03 '23 18:10 isaac-j-miller

Sorry, somehow this slipped through the cracks and I didn't get to reviewing until now. This PR adds 3 ways to ignore:

  • The --ignore option, which allows multiple patterns
  • The --ignore-file option, which accepts a file path
  • The .ejslintignore file

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:

  • --ignore is 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 do ejslint --ignore ignore.ejs *.ejs
  • Adding support for .ejslintignore is 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 --ignore a string. If you have multiple ignore patterns, you can use --ignore-file.
  • Remove .eslintignore support; anyone who wants it can simply run --ignore-file .eslintignore.

That said, I'm open to feedback if you disagree.

RyanZim avatar Jan 13 '24 19:01 RyanZim