-
Notifications
You must be signed in to change notification settings - Fork 74
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
linting is too slow #2621
Comments
Agreed. Here's some numeric analysis, with sample size 1. Latest CI had total duration 11m33s. lint was the bottleneck at 11m22s and the next slowest (viable release) was just 6m. The lint job spent 8m33s on on Looking over the other suggestions,
This would help, but I don't think by a lot. ESlint runs on files mostly in isolation. A big drawback is a the change in workflow with this repo. Given the large overlap of developers with agoric-sdk it would require a change there too or a divergence.
Two reasons not to do that:
Indubitably. tseslint needs review and I've filed ESLint v9,
Why packages are linted individually… I wasn't here for the decision but I imagine it had something to do with "lint what I'm working on" and "let me configure this differently here". There are better ways meet those, imo, but it's not worth the disruption. If we do the above then lint will no longer be a bottleneck for CI. If you want your dev environment to lint faster, we could consider more parallelization. But that deserves its own issue because the trade-offs and considerations are different than for CI. I'm updating this issue title to be about CI. Acceptance criteria I propose that we can close this issue when the lint job is within 10% of the next slowest job. I think we'll get that through,
|
re: packages linted individually. I have a feeling it will actually be significantly more performant to run it once from the workspace root; not because of ESLint proper, but tseslint. It needs to bootstrap TS for each project, and it may not be able to take advantage of caching. This is compounded by the fact that the projects are also not incrementally built--it may be that tseslint has to recompile entire dependency trees with (but I haven't profiled it so who knows? how to profile multiple processes in serial and aggregate the results, anyway?) I mean, there are several choices made here that have a negative performance impact. Ostensibly they are done for DX reasons. I'm trying not to be a blowhard here, but: my experience suggests that concern about the workflow changing is a concern about change or learning a new workflow instead of any fundamental shortcoming of an incrementally-built project-based monorepo. I've worked in several of these (including LavaMoat) and have never felt that it negatively impacts my productivity (some recent version of re: commit hook. how slow is too slow? Formatting staged files on commit is not something I've ever known to feel slow. I typically run re: title change. I meant what I wrote: linting is too slow. CI linting is even slower. 😄 |
The output of the
lint
job for my latest PR:This is far too slow. My suggested solution(s):
typescript-eslint
, do not runtsc
; tseslint invokestsc
anyway and it is redundant.eslint
individually for each package. Run it once, in the workspace root.a. Run the
prettier
check once in the workspace rootb. (Controversial) Omit the
prettier
check entirely. Use lint-staged and husky as a pre-commit hook to runprettier --write
on the staged files (alsoeslint --fix
).c. Do a., but also add the pre-commit hook.
The text was updated successfully, but these errors were encountered: