add --list-target-files option
See original GitHub issueThe version of ESLint you are using.
5.7.0
The problem you want to solve.
I’m working on https://awesomecode.io, our users may not use eslint
directly on their shell, we have a requirement to list target files so that our users can add ignore patterns properly.
Your take on the correct solution to problem.
We can add prefix DEBUG=eslint:linter
to get target files, but it’s very slow and its output contains too many verbose text.
My solution is to add --list-target-files
option, then it gets all target files without parsing files, so it’s super fast. Its output is straightforward, only lists the target filenames.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Basic Usage :: RuboCop Docs
--init. Generate a .rubocop.yml file in the current directory. ; -l/--lint. Run only lint cops. ; -L/--list-target-files. List all files RuboCop will inspect....
Read more >org.apache.hadoop.tools.CopyListing.buildListing java code ...
The interface to be implemented by sub-classes, to create the source/target file listing. getConf · setConf · setCredentials. set Credentials store, on which...
Read more >Add list items - Microsoft Support
To attach one or more files to the list item, click Add attachments, locate the file, and then click Open. Hold down the...
Read more >Class: RuboCop::Options Private - Doc Index
Creates a section of options in order to separate them visually when using --help . Instance Method Details. #add_additional_modes(opts) (private).
Read more >File: README — Documentation for rubocop (0.36.0)
gem install rubocop ... -L/--list-target-files, List all files RuboCop will inspect. ... By adding the option --exclude-limit COUNT , e.g., ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Have you tried using the
CLIEngine#resolveFileGlobPatterns
API. That should cover all of the ESLint-specific logic for resolving glob patterns, and then you would be able to use a general-purpose tool for resolving glob patterns to get a list of files.At the moment, I’m not strongly opposed to adding an option, but I’m also not convinced that an option would be necessary/generally useful.
Hi, thanks for creating an issue.
If I’m understanding correctly, the problem you’re trying to solve is to figure out how ESLint resolves your globs and lints your files, for debugging purposes. It’s already somewhat possible to do this with the
DEBUG
environment variable. For example, if I run something like this:DEBUG=eslint:linter eslint tools/
Then ESLint generates output like this:
Output
In other words, I’m not sure adding a new command-line flag is necessary given that there’s already a way to do this. Does the ability above satisfy your use case?