Skip to content
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

Speed up ESLint precommit checks #1002

Closed
5 tasks done
Mythie opened this issue Mar 8, 2024 · 3 comments · Fixed by #1008
Closed
5 tasks done

Speed up ESLint precommit checks #1002

Mythie opened this issue Mar 8, 2024 · 3 comments · Fixed by #1008
Assignees
Labels
help wanted Extra attention is needed status: assigned Issue has been assigned type: enhancement Enhancing a existing feature

Comments

@Mythie
Copy link
Collaborator

Mythie commented Mar 8, 2024

Describe the improvement you are suggesting in detail

Currently it takes quite a while for ESLint to run during our precommit checks, we've attempted doing this with lint-staged with the following:

  • The entire repository being linted
  • Just the staged files being linted in one command e.g. eslint --fix a.ts b.ts c.ts
  • Just the staged files being linted in multiple commands e.g. eslint --fix a.ts && eslint --fix b.ts

Additional Information & Alternatives (optional)

This super long precommit time can scare off contributors and makes general development painful since you can be stuck on the linting stage for seconds up to minutes depending on the size of your commit (yes I know keep commits small, I'm sorry!).

Improving this will be a net benefit to DX for both contributors and the Documenso team.

Do you want to work on this improvement?

No

Please check the boxes that apply to this improvement suggestion.

  • I have searched the existing issues and improvement suggestions to avoid duplication.
  • I have provided a clear description of the improvement being suggested.
  • I have explained the rationale behind this improvement.
  • I have included any relevant technical details or design suggestions.
  • I understand that this is a suggestion and that there is no guarantee of implementation.
@Mythie Mythie added type: enhancement Enhancing a existing feature help wanted Extra attention is needed labels Mar 8, 2024
@github-actions github-actions bot added the status: triage Scope to be determined label Mar 8, 2024
@Mythie Mythie removed the status: triage Scope to be determined label Mar 8, 2024
@rohit-saluja
Copy link
Contributor

can you assign me this issue.

@Mythie Mythie added the status: assigned Issue has been assigned label Mar 8, 2024
@Mythie
Copy link
Collaborator Author

Mythie commented Mar 8, 2024

Assigned, best of luck! We aren't expecting it to be incredibly fast but right now it's painstakingly slow.

I'd suggest creating like 30-50 dummy .ts files with content to test the slowdown during precommit 😄

@rohit-saluja
Copy link
Contributor

created a pr for this

Mythie added a commit that referenced this issue Mar 10, 2024
I found out that the problem of slow down is the use of
parseOption.project with multiple tsconfig files which increases usage
of memory consumption quite a lot.

Here is the reference I found to resolve this issue:

[reference
link](typescript-eslint/typescript-eslint#1192)
[Doc
link](https://typescript-eslint.io/getting-started/typed-linting/monorepos/)

Based on this reference I created the solution and tested out locally it
does reduce the eslint time.

#1002
@dguyen dguyen linked a pull request Apr 8, 2024 that will close this issue
@dguyen dguyen closed this as completed Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed status: assigned Issue has been assigned type: enhancement Enhancing a existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants