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
Using functions as linters prints file list to console, static linters do not #674
Comments
Yes, the behaviour of Maybe we could generate the name separately by using |
+1 For this, and the performance seems wrose. |
+1 Possible to introduce an option to omit or truncate the file list re: function linters? We have to resolve large merge commit conflicts pretty regularly, and moving to a functional linter was the only way we could ignore files from match. I don't want to suppress all of lint-staged's output with the -q flag because I don't think it should be an entirely invisible thing. |
* refactor: remove usage of `linter` and prefer `command` * test: remove full snapshot since new git version changed the text * improvement: create shorter titles for function tasks with many staged files Closes #674
🎉 This issue has been resolved in version 9.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Hello, I am looking at migrating our
lint-staged
config inpackage.json
to alint-staged.config.js
file, moving fromv8.1.5
tov9.2.1
.I've noticed something relatively minor in the console output that could be tweaked for a smoother experience.
When I just moved our JSON based config into the file everything worked as expected. However when I tried to pass functions for linters, this is when I noticed that the entire file list would be passed through to
Listr
and be output in the console when a function is detected as the linter. Here is an example of the output I am seeing:The trouble with the above is, as I said relatively minor, however it gets a bit nastier when there are many files in the change list. We are working in a medium sized TypeScript monorepo that if you fall behind
master
for 3-4 days you will definitely have many files when pulling. I personally ran into problems during merge conflicts where I would be forced to runpre-commit
against hundreds of changes from themaster
merge in potentially each project. In that case the console output whileListr
is doing it's thing would be quite nasty:It would be nice to have consistent, clean output while
Listr
is printing the stages to the console. I believe when no linter function is used and just a glob + static command is found, no files are printed.Steps to reproduce
Use a function as a linter in
v9.2.1
Environment
lint-staged
: v9.2.1The text was updated successfully, but these errors were encountered: