Open DustyDogCodex opened 1 year ago
Here is my stance: we should simply create a lint-staged
script, which is similar in concept to the test-staged
script, running the correct linters only for what has been staged.
My reasoning is as follows:
test-staged
script.lint-staged
script should be relatively simple, following the pattern established by test-staged
, simpler than the benefit that adding the lint-staged
package would haveBasically, I see the lint-staged
package adding more burden than pain it's alleviating, but if there is a big selling point of it that I'm missing out on, please let me know
hi @BSFishy ,
Thank you for your input!
The main selling point of lint-staged
to me was the ease of use. Install, setup config and its good to go!
However, I agree with the points you brought up regarding the fact the this project currently already uses scripts and that this package might add more surface area for maitenance. You are correct in stating that a script might just be simpler, so I will focus on writing that next.
Cheers!
Is your feature request related to a problem? Please describe.
In issue #1070 , it was mentioned that currently the pre-commit hook runs
yarn lint
for the entire codebase and not specifically for only the staged files. While working on this issue I came across a npm packaged calledlint-staged
which does exactly this. By usinglint-staged
, the lint commands only lints files that have been modified and have been staged for committing.@joshuarrrr recommended opening this as an issue to get dev feedback on whether or not to add this as a dependency to the project. I would love to hear everyone's thoughts on whether it will be helpful using this dependency.
Describe the solution you'd like
Adding
lint-staged
would significantly reduce linting time by only checking files that have been modified.Describe alternatives you've considered
@BSFishy suggested a simple script akin to the current
test-staged
script. I am currently working on trying to implement this and see if I can create a script that can replicatelint-staged
's features.Additional context
NPM documentation for
lint-staged
: https://www.npmjs.com/package/lint-staged?activeTab=readme