-
Notifications
You must be signed in to change notification settings - Fork 337
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
Add React exhaustive-deps and compiler ESLint rules #6972
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected] |
d3d7870
to
f787bb2
Compare
df884fb
to
6de8276
Compare
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.
Reviewed 1 of 1 files at r1, 47 of 64 files at r2.
Reviewable status: 21 of 83 files reviewed, all discussions resolved
gui/src/renderer/components/NotificationBanner.tsx
line 168 at r2 (raw file):
}, [props.children]); // eslint-disable-next-line react-hooks/exhaustive-deps
A motivation why the lint rule is disabled would be nice:)
Code quote:
// eslint-disable-next-line react-hooks/exhaustive-deps
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.
Reviewed 17 of 64 files at r2, 3 of 3 files at r3, 12 of 12 files at r4, 5 of 5 files at r5, 52 of 52 files at r6, 1 of 1 files at r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
gui/test/unit/notification-evaluation.spec.ts
line 31 at r5 (raw file):
before(() => { sandbox = sinon.createSandbox(); // @ts-expect-error Way to many methods to mock.
too*
Code quote:
to
6de8276
to
5670372
Compare
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've now made all the updates we talked about yesterday.
Reviewable status: 0 of 84 files reviewed, all discussions resolved (waiting on @MarkusPettersson98)
gui/src/renderer/components/NotificationBanner.tsx
line 168 at r2 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
A motivation why the lint rule is disabled would be nice:)
This was removed in a later commit.
gui/test/unit/notification-evaluation.spec.ts
line 31 at r5 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
too*
Done!
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.
Reviewed 7 of 7 files at r8, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
d1f769c
to
19dcb5a
Compare
19dcb5a
to
217f4dc
Compare
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.
Reviewed 1 of 1 files at r9, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @raksooo)
gui/src/renderer/components/EditApiAccessMethod.tsx
line 73 at r9 (raw file):
const enabled = id === undefined ? true : (method?.enabled ?? true); const updatedMethod = { ...newMethod, enabled }; console.log(JSON.stringify(updatedMethod));
Should this console.log
be left in? 😊
Code quote:
console.log(JSON.stringify(updatedMethod));
217f4dc
to
1cd99b3
Compare
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.
Reviewable status: 81 of 83 files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)
gui/src/renderer/components/EditApiAccessMethod.tsx
line 73 at r9 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
Should this
console.log
be left in? 😊
Thanks for spotting that! Removed!
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.
Reviewed 2 of 2 files at r10, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
1cd99b3
to
03f4f4f
Compare
03f4f4f
to
cf62ffd
Compare
This PR adds the React hooks
exhaustive-deps
rule and the React compiler rule to ESLint. I've also prohibited@ts-ignore
comments and replaced the existing ones with@ts-expect-error
, and done some general clean up.There is no good way to implement
WillExit
anduseWillExit
that conforms with these rules (and Reacts design principles) so I removed those as they won't be needed in the upcoming PR where we move to the JavaScript ViewTransition API.I really suggest going through this PR commit-by-commit.
Fixes DES-1314.
This change is