-
Notifications
You must be signed in to change notification settings - Fork 760
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
Make linting less badder #3794
Make linting less badder #3794
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
LGTM
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.
2 questions. It also seems the style we have in the configs is now changed, since a lot of files got committed which seem to have lint changes?
@@ -2,9 +2,9 @@ | |||
REMOTE=$(git rev-parse --symbolic-full-name --abbrev-ref @{u}) | |||
|
|||
if [ -z "$REMOTE" ]; then | |||
FILESCHANGED=". --ext .js,.jsx,.ts,.tsx" | |||
FILESCHANGED=". --ext .js,.ts" |
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.
We now ignore tsx
here, is this intended? Also for jsx
below
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.
Yes, we don't use tsx
and jsx
in our code base. Unless we start writing front-end web apps, we never will, so no point in checking for them.
rules: { | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'no-invalid-this': 'off', | ||
'no-restricted-syntax': 'off', |
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.
Why do these specific packages have these exceptions?
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.
I carried these over from the previous package-specific lint configs. We can go through them and see if they can be removed.
I think there was maybe one subtle difference between prettier and biome and that accounts for most of the file changes. It was just a little bit of formatting difference (e.g. adding a new line between closing brackets and opening of a new line sort of thing). |
This reimagines our lint process and hopefully makes it at least 2-3x faster
prettier
withbiome
(almost exactly conforms to prettier standards but rust so therefore faster...maybe) for formatting and remove this from theeslint
configno-undef
(Typescript will catch any use of real undefined stuff. This was just flagging for us referencingNodeJS
indevp2p
import/named
/import/namespace
/import/default
are all turned off -typescript-eslint
explicitly suggests disabling theseeslint
from the root of the monorepo. This is the biggest win as our previous way of running the linter per package was causing dramatic slowdowns since it was basically starting up the linter and parsing the file tree for each packageprettier
andtsconfig.lint.json
package specific config files as these are no longer neededprecommit
andprepush
git hooks to use the new linting setupThis is an alternative to Make linting greater again #3792 where we replace prettier with
biome
just for formatting and then run the linter from the directory root rather than from each package (which means we only start the linter up once instead 13 times). Together, these have reduced the time to lint the monorepo by 2.5x on my slow-mo Intel i9 processor from 2022.