-
Notifications
You must be signed in to change notification settings - Fork 157
Modernise and cleanup lint configuration and build process #1177
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
base: main
Are you sure you want to change the base?
Conversation
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Modernise and cleanup lint configuration and build process
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
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.
Pull Request Overview
This PR modernises the repository’s lint and build setup by consolidating config files at the root, upgrading linting engines and Node, and streamlining scripts and workflows.
- Centralise ESLint, Prettier, Solhint, Markdown and YAML configs in the monorepo root
- Upgrade to Node 20, modernise
package.json
scripts, Yarn workspaces and Husky hooks - Refactor Hardhat configuration, import sorting, and incremental lint/build caching
Reviewed Changes
Copilot reviewed 84 out of 84 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/contracts/scripts/analyze | Updated Slither’s artifacts directory to ./artifacts |
packages/contracts/prettier.config.js | Removed inherited config; now uses root config |
packages/contracts/prettier.config.cjs | Added local wrapper extending root Prettier config |
packages/contracts/package.json | Bumped version, overhauled scripts, deps and files |
packages/contracts/hardhat.config.ts | Refactored task loading, networks, compiler and plugins |
packages/contracts/eslint.config.js | Deleted legacy ESLint wrapper (now handled at root) |
packages/contracts/contracts/tests/arbitrum/ArbSysMock.sol | Added ArbSys mock for L2 testing |
packages/contracts/addresses.json | Added local 1337 addresses, inlined initArgs |
packages/contracts/.solhintignore | Removed obsolete Solhint ignore file |
packages/contracts/.markdownlint.json | Added package-specific MarkdownLint config |
package.json | Upgraded workspace scripts, devDeps, lint-staged |
eslint.config.mjs | Added root ESLint monorepo config with ignore logic |
.yarnrc.yml | Adjusted Yarn settings |
.yarn/patches/typechain-npm-8.3.2-b02e27439e.patch | Patched TypeChain to await async output in IO step |
.husky/pre-commit | Simplified hook to run top-level lint-staged |
.github/workflows/lint.yml | Introduced comprehensive multi-linter GitHub Action |
.github/actions/setup/action.yml | Upgraded Node.js setup to v20 |
.solhint.json | Removed prettier/prettier rule from Solhint config |
.markdownlint.json | Added root MarkdownLint rules |
.yamllint | Added YAMLLint configuration |
Comments suppressed due to low confidence (3)
packages/contracts/hardhat.config.ts:116
- The network key
localnitrol1
appears to have a typo and is inconsistent—consider renaming it to something likelocalNitro1
or a clearer name (e.g.localArbitrumOne
).
localnitrol1: {
packages/contracts/.solhintignore:1
- Removing the
.solhintignore
file means Solhint will no longer ignore these directories; consider migrating those ignore patterns into your root.solhint.json
to prevent unintended lint failures.
node_modules
package.json:19
- The
lint:md
script references.markdownlintignore
, but that file isn't added to the repo. Either remove the--ignore-path .markdownlintignore
option or add the corresponding ignore file.
"lint:md": "markdownlint --fix --ignore-path .gitignore --ignore-path .markdownlintignore '**/*.md'; prettier -w --cache --log-level warn '**/*.md'",
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.
Shared some comments over slack but looks good to me.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1177 +/- ##
==========================================
- Coverage 92.83% 86.06% -6.78%
==========================================
Files 47 47
Lines 2415 2074 -341
Branches 438 613 +175
==========================================
- Hits 2242 1785 -457
- Misses 173 289 +116
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
After messy fiddling around, all workflows now pass. Code coverage has gone down as a result of skipping some problematic tests for coverage. This is a shame, but I think good enough for now, can be improved again over time and when (and if) we need to work on those areas again. Some more refinements pending from other branches, but if reviewed again I hope good enough to merge now. |
NOT READY YET, trying to resolve build failures, due to version conflicts I think.
eslint-graph-config
andsolhint-graph-config
to be configuration files in repo root that are inherited from for packages. It is presumed we do not need to maintain these config packages for external dependencies, and they have been deleted.eslint-plugin-simple-import-sort
. Also sorts exports.All tests still pass, but I had to make changes to token-distribution tests to get them to pass. I suspect the new version of Hardhat does not allow negative changes to block time, causing exceptions in test execution. The tests log warnings that, if we need to revisist token-distribution in the future, should be investigated to ensure the tests are effective.
Although the tests pass, due to multiple substantial version upgrades and build changes this PR could cause subtle issues that have not been discovered. I expect this upgrade is not perfect, please contact me if you notice an introduced issue, however I recommend that (after sanity testing by others in their environment) we make the upgrade and seek to 'fail-forward' on