Skip to content

chore(utils): resolve in operator lint suppressions - #10248

Draft
cryptodev-2s wants to merge 1 commit into
mainfrom
chore/utils-fix-in-operator-suppressions
Draft

cryptodev-2s wants to merge 1 commit into
mainfrom
chore/utils-fix-in-operator-suppressions

Conversation

@cryptodev-2s

Copy link
Copy Markdown
Contributor

Explanation

Clears the 6 no-restricted-syntax suppressions the @metamask/utils migration left in eslint-suppressions.json. All 6 are the in operator.

hashing.ts (3): the 'crypto' in globalThis guard was redundant with the typeof globalThis.crypto === 'object' check on the next line, so it is gone. Identical behaviour.

errors.ts (3): these stay, now with inline disables explaining why. hasProperty is own property only, and prototype lookup is the point here:

'message' in new Error()        // true
Object.hasOwn(new Error(), 'message')  // false

Same for code defined on an error subclass prototype. Swapping would silently change isErrorWithMessage, isErrorWithCode and isErrorWithStack, which are public exports.

No behaviour change, so no changelog entry.

References

Follows #10185

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant