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

feat(config): allow defining files via flag #201

Merged
merged 2 commits into from
May 23, 2024

Conversation

merrywhether
Copy link

Fixes

Proposed Changes

  • Adds the --files flag as an alias of the [...files] array to allow for easier overriding of .escheckrc files.

Comment on lines +136 to +138

--not=target1,target2 An array of file/folder names or globs that you would like to ignore. Defaults to `[]`.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added surrounding newlines to match pattern elsewhere

@@ -30,6 +30,7 @@ program
.argument('[files...]', 'a glob of files to to test the EcmaScript version against')
.option('--module', 'use ES modules')
.option('--allow-hash-bang', 'if the code starts with #! treat it as a comment')
.option('--files <files>', 'a glob of files to to test the EcmaScript version against (alias for [files...])')
Copy link
Author

@merrywhether merrywhether May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't include the -f short flag from the original proposal since it didn't seem to fit with the style of the other flags.

Comment on lines +57 to +60
if (filesArg && filesArg.length && options.files) {
logger.error('Cannot pass in both [files...] argument and --files flag at the same time!')
process.exit(1)
}
Copy link
Author

@merrywhether merrywhether May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd originally thought to have the argument override the flag, but then I could see someone misunderstanding that maybe they got concatenated and it seemed like erroring is the only safe option. Totally open to feedback on this idea or the error message text.

@yowainwright
Copy link
Owner

@merrywhether will look asap!!! 🎉

Copy link
Owner

@yowainwright yowainwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature!

@yowainwright yowainwright merged commit fc2af8b into yowainwright:main May 23, 2024
3 checks passed
@merrywhether merrywhether deleted the files-flag branch June 13, 2024 05:16
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.

Flag option for specifying files
2 participants