json-rpc-engine: Wildcard exports -> named exports #4462
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation
Using wildcard exports makes it difficult to understand what a package exports and makes it possible for new exports to get added accidentally.
This commit updates the
@metamask/json-rpc-engine
package to use named exports instead of wildcard exports, and adds a test to verify non-type exports following other packages.References
This relates to the following ticket on
eslint-config
: MetaMask/eslint-config#331I've created this PR as an example for Devin, an AI tool we are testing at Consensys. The idea is that Devin can use this PR to perform similar work on other packages in this repo.
Changelog
There should be no functional changes. All exports should be the same as they were before.
To verify this, search through
packages/json-rpc-engine
for exports (lines beginning withexport
) and cross-reference this with the list inindex.ts
.Checklist