Bump ESLint and related dependencies, and fix lint errors#1014
Bump ESLint and related dependencies, and fix lint errors#1014
Conversation
| this.updateIdentities(await this.#keyring.getAccounts()); | ||
| this.fullUpdate(); | ||
| this.#updateIdentities(await this.#keyring.getAccounts()); | ||
| await this.fullUpdate(); |
There was a problem hiding this comment.
This potentially changes the behaviour of this function. We may want to do this instead:
| await this.fullUpdate(); | |
| this.fullUpdate().catch(console.error); |
| this.updateIdentities(await this.#keyring.getAccounts()); | ||
| this.fullUpdate(); | ||
| this.#updateIdentities(await this.#keyring.getAccounts()); | ||
| await this.fullUpdate(); |
There was a problem hiding this comment.
This potentially changes the behaviour of this function. We may want to do this instead:
| await this.fullUpdate(); | |
| this.fullUpdate().catch(console.error); |
| type: string; | ||
| accounts: string[]; | ||
| getAccounts(): string[]; | ||
| getAccounts(): string[] | Promise<string[]>; |
There was a problem hiding this comment.
This is an assumption I made, since getAccounts() is awaited further on.
| opts.requestData, | ||
| ); | ||
| this._showApprovalRequest(); | ||
| await this.#showApprovalRequest(); |
There was a problem hiding this comment.
This potentially changes the behaviour of this function. We may want to do this instead:
| await this.#showApprovalRequest(); | |
| this.#showApprovalRequest().catch(console.error); |
There was a problem hiding this comment.
Aside: Original looks like it could be a mistake? 🤔
I'd expect the two promises (this.#showApprovalRequest and this.#add) to be either serially resolved (await or then), or returned together via a Promise.all?
There was a problem hiding this comment.
It may be, but that's probably something we can decide later.
f1acb29 to
70c1a33
Compare
|
Can the (potential) behavior changes be replaced with |
mcmire
left a comment
There was a problem hiding this comment.
Good work on this. Most of the comments here are minor but there are a few cases that are more blocking than others.
| 'Invalid decimals "-1": must be 0 <= 36.', | ||
| ); | ||
|
|
||
| // eslint-disable-next-line require-atomic-updates |
There was a problem hiding this comment.
What's the lint message here? Wondering if there is a way to fix this other than bypassing.
There was a problem hiding this comment.
ESLint: Possible race condition:
asset.decimalsmight be assigned based on an outdated state ofasset.(require-atomic-updates)
| this.#subjectsWithoutPermissionsEncounteredSinceStartup.add(origin); | ||
|
|
||
| this.update((draftState) => { | ||
| // Typecast: ts(2589) |
There was a problem hiding this comment.
Does this comment still apply?
| * Stores domain metadata for the given origin (subject). Deletes metadata for | ||
| * subjects without permissions in a FIFO manner once more than | ||
| * {@link SubjectMetadataController.subjectCacheLimit} distinct origins have | ||
| * {@link SubjectMetadataController.#subjectCacheLimit} distinct origins have |
There was a problem hiding this comment.
Is this worth linking to if it's a private method? (Such a link may not be accessible in the generated docs.)
There was a problem hiding this comment.
There may be other examples of this that I came across but didn't comment on. I'll take a look later to see if I can find them.
There was a problem hiding this comment.
Good point, probably not. I think either way (even with the private modifier), this wouldn't be included in the doc.
| chainId: parseInt(chainId, NaN), | ||
| networkId: parseInt(networkId, NaN), |
There was a problem hiding this comment.
Is NaN appropriate here? Should this be 16 or 10?
There was a problem hiding this comment.
I'm not sure. NaN is the equivalent of undefined, so that's why I used that.
There was a problem hiding this comment.
Interesting... I did not know that.
| "esModuleInterop": true, | ||
| "noEmit": true | ||
| "noEmit": true, | ||
| "strictNullChecks": true |
There was a problem hiding this comment.
Huh... I thought this was covered by strict.
There was a problem hiding this comment.
@typescript-eslint was complaining without this.
There was a problem hiding this comment.
This is covered by strict, but we don't have strict enabled here. It's just in the packages tsconfig.
|
@Mrtenz I would love to see this merged! That said, I do agree with @legobeat in that the breaking changes in this PR are a bit difficult to discern due to the size. I also wonder if it would be beneficial to bypass these violations for now and then add them in a future PR so that they are more visible. Maybe we could even override the private field rule so that it's ignored for now and add that in its own PR since it affects so many files. I am happy to help with this, just let me know. |
94a0e7e to
9c62a28
Compare
|
New attempt: #1498 |
|
Since #1498 has been merged, should we close this pull request? |
This bumps ESLint and related dependencies to the latest version. I've also removed some custom rules from the ESLint config, as they seem to be unnecessary.
Packages to fix:
address-book-controllerannouncement-controllerapproval-controllerassets-controllerbase-controllercomposable-controllercontroller-utilsens-controllergas-fee-controllerkeyring-controllermessage-managernetwork-controllernotification-controllerpermission-controllerphishing-controllerpreferences-controllerrate-limit-controllersubject-metadata-controllertransaction-controllerBreaking changes
While I tried to keep breaking changes to a minimum, there are a few: