forked from hyperlane-xyz/hyperlane-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: browser compatibility checks (hyperlane-xyz#5288)
### Description This PR enhances the ESLint configuration to restrict the usage of Node.js built-in modules across the codebase. This is particularly important for the SDK package which needs to maintain browser compatibility for frontend integrations. Key changes: - Added comprehensive ESLint rules to prevent usage of Node.js specific modules (fs, path, crypto, etc.) - Updated error messages to guide developers towards environment-agnostic alternatives. (alternatives can be mentioned later on) - Created a separate ESLint config for the Solidity package - Excluded test files and AWS-related code from these restrictions ### Drive-by changes - Added ESLint dependency to solidity/package.json - Removed redundant eslint-disable comments from test files - Updated lint script in solidity/package.json to use the new config ### Related issues hyperlane-xyz#5277 ### Backward compatibility Yes. These changes only affect development-time linting and do not impact runtime behavior. ### Testing Manual testing: - Verified ESLint rules correctly flag Node.js built-in module imports - Confirmed test files in excluded directories are not affected - Validated lint commands work as expected in both root and solidity packages --------- Co-authored-by: Morteza Shojaei <[email protected]>
- Loading branch information
1 parent
bed81f7
commit ba50e62
Showing
8 changed files
with
114 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@hyperlane-xyz/sdk': patch | ||
'@hyperlane-xyz/core': patch | ||
--- | ||
|
||
Added ESLint configuration and dependency to enforce Node.js module restrictions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import MonorepoDefaults from '../eslint.config.mjs'; | ||
|
||
export default [ | ||
...MonorepoDefaults, | ||
{ | ||
ignores: [ | ||
'./test/**/*', | ||
'./dist/**/*', | ||
'.solcover.js', | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters