Is lint-staged
still relevant when using Turborepo?
#2595
-
I recently set up a new monorepo for my team using turborepo (first-time user). In most of our repositories, we have the usual build tooling (tsc building, eslint linting, jest testing), but we also usually set up Is lint-staged still relevant when using turborepo? To demonstrate, my package.json has this "lint-staged": {
"apps/**/*.{js,ts,jsx,tsx}": [
"eslint --fix"
]
} This works just fine, but it clearly has one problem, it's not using my I'm still pretty new to Turborepo, and I haven't fully explored this, but I couldn't find any blogs/docs about this tool in particular as it relates to Turbo, so wanted to raise the question to see if anyone else has considered it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is actually a fantastic question! In this scenario Turborepo doesn't provide any particularly compelling benefits:
In theory, the incremental cache from ESLint would imply that you do not need to explicitly specify the staged files in order to get approximately equivalent performance to what Turborepo can provide, and, since it's regarding local changes, it won't ever provide value for others via shared caching. Now, if your |
Beta Was this translation helpful? Give feedback.
This is actually a fantastic question!
In this scenario Turborepo doesn't provide any particularly compelling benefits:
--fix
on a commit hook.In theory, the incremental cache from ESLint would imply that you do not need to explicitly specify the staged files in order to get approximately equivalent performance to what Turborepo can provide, and, since it's regarding local changes, it won't ever provide value for others via shared caching.
Now, if your
lint
task has dependencies, (e.g. type generation) you can still leverage Turborepo to invoke the command using an a…