Add `--since` CLI option to only lint changed files
See original GitHub issueThe version of ESLint you are using.
7.23.0
The problem you want to solve.
Only lint files that have changed since a feature branch was created, or since a particular commit, to save time by avoiding linting unchanged files.
This would be similar to functionality in other tools like jest (https://jestjs.io/docs/cli#--changedsince), lerna (https://github.com/lerna/lerna/tree/main/core/filter-options#--since-ref), and prettier (https://github.com/azz/pretty-quick).
Your take on the correct solution to problem.
I would like to propose adding a new --since
CLI option to eslint, which would take a branch name or commit hash. The branch name or commit hash would be used to determine all the files changed between that commit and the current state. This would run the same as if eslint was run via CLI, with all the changed filenames passed in as arguments.
I’ve tested this concept out in https://github.com/jdanil/eslint-changeset.
Are you willing to submit a pull request to implement this change?
Yes. But my changes would be restricted to supporting git, as I am not familiar with other SCM systems.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
I’m not thrilled with baking in any SCM-specific knowledge. This seems like something a script built on top of ESLint could do in a single line.
All good. Thanks for considering it.