-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
feat: speed up eslint parser timing #3250
Conversation
@@ -7,7 +7,6 @@ module.exports = { | |||
'prettier', | |||
'plugin:prettier/recommended', | |||
'plugin:promise/recommended', | |||
'plugin:@cspell/recommended', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should remove .cspell.json file too. Or are we keeping it in the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@p-fernandez keeping it in CI, just making sure locally our linter will run faster
@@ -37,7 +37,6 @@ export class InviteMember { | |||
if (process.env.NOVU_API_KEY && (process.env.NODE_ENV === 'dev' || process.env.NODE_ENV === 'production')) { | |||
const novu = new Novu(process.env.NOVU_API_KEY); | |||
|
|||
// eslint-disable-next-line @cspell/spellchecker | |||
// cspell:disable-next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should remove all the ocurrences of cspell anotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second annotation helps the CI skip this one. I only removed the eslint one here
What change does this PR introduce?
This PR introduces a performance improvement to eslint by localizing the ts parser options to the scanned object rather than the whole repo from the root. This change resulted in a significant reduction in test case running time, from 20s to 5s. Additionally, cspell has been removed from eslint, as it caused more than 70% of the time spent when linting.
Why was this change needed?
This change was needed to improve the performance of eslint, which was previously slow due to the ts parser options being applied to the entire repo from the root. This caused husky pre commit take a forever amount of time to complete
Before:
After:
Cspell took almost all the time, now we will only run it in CI.