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

add --ignore, --ignorefile options to CLI #124

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

isaac-j-miller
Copy link

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.

@RyanZim
Copy link
Owner

RyanZim commented Jan 13, 2024

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.

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

Successfully merging this pull request may close these issues.

2 participants