build(solidity): migrate to ESLint 10 flat configs - #4302
Merged
piotr-roslaniec merged 11 commits intoSep 13, 2026
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Sep 8, 2026
- Add 9 missing error-severity core rules (no-new-func, no-promise-executor- return, no-unreachable-loop, no-dupe-else-if, no-unsafe-optional-chaining, no-useless-backreference, no-constructor-return, grouped-accessor-pairs, default-param-last) that were active under the old shared airbnb-based config but did not carry over to the flat config. - Drop 3 default-value-only options (import/order's distinctGroup/ sortTypesGroup/named, import/no-unresolved's caseSensitiveStrict, import/no-cycle's allowUnsafeDynamicCyclicDependency) that only restated plugin defaults and obscured this package's real differences from random-beacon's config. - Add a committed ESLint policy regression test (scripts/test-eslint- policy.mjs) asserting no-only-tests fires, typechain/** stays ignored, and ordinary test files are actually linted - guards against a future config edit silently weakening any of the three. - Rename lint:eslint/lint:fix:eslint to lint:ts/lint:fix:ts to match the domain-naming convention lint:sol/lint:config already use, since the script now also runs Prettier.
- Add 9 missing error-severity core rules (no-new-func, no-promise-executor- return, no-unreachable-loop, no-dupe-else-if, no-unsafe-optional-chaining, no-useless-backreference, no-constructor-return, grouped-accessor-pairs, default-param-last) that were active under the old shared airbnb-based config but did not carry over to the flat config. - Add an explicit no-await-in-loop: off entry (with a comment noting ecdsa uses ["error"]) instead of leaving the rule silently unconfigured, since this package's eslint-disable guard comments for it were already removed by the parent migration. - Remove two orphaned blank lines left behind where eslint-disable-next-line no-await-in-loop directives were deleted, one of which stranded an explanatory comment from the statement it described. - Add a committed ESLint policy regression test (scripts/test-eslint- policy.mjs) asserting no-only-tests fires, typechain/** stays ignored, and ordinary test files are actually linted. - Rename lint:eslint/lint:fix:eslint to lint:ts/lint:fix:ts to match the domain-naming convention lint:sol/lint:config already use.
solidity/ecdsa/package-lock.json (an npm lockfile in a Yarn-managed package) still pinned the git-tarball @thesis-co/eslint-config dependency this PR already removed from package.json, which would keep dependency scanners reporting it as present. The package installs via yarn.lock; this file was unused.
…ptional-chaining Verified the actual removed @thesis-co/eslint-config source (github.com/ thesis/eslint-config@778365b) against upstream eslint-config-airbnb-base 15.0.0: no-unsafe-optional-chaining was active there as ['error', { disallowArithmeticOperators: true }], not the bare ['error'] this PR's earlier fix restored. Brings the rule back to full fidelity with the original policy.
…unsafe-optional-chaining
Same fidelity fix as the sibling ecdsa commit: the actual removed
@thesis-co/eslint-config (via eslint-config-airbnb-base 15.0.0) set this
rule to ['error', { disallowArithmeticOperators: true }], not the bare
['error'] restored earlier.
…4304) Both Solidity packages now use Solhint 6.2.4. The Git-pinned `solhint-config-keep` dependency is replaced with explicit local rules, preserving its error/warning policy and the existing constructor/assembly overrides. The removed event-naming rule is migrated to `event-name-capwords`. Closes #4214 together with the prerequisite ESLint PR #4302 and Prettier PR #4303. This is stacked on #4303. The stack depends on #4208; coordinate the Node 24 runtime rollout in #4205 and stacked-branch CI support in #4217 before merging the toolchain stack. Warnings remain deliberately non-blocking in this migration. Solhint 6 reports 14 beacon and 12 ECDSA warnings, primarily declaration ordering and state counts, with no errors. The new analyzer detects a few additional ordering cases; the existing error rules are not weakened to accommodate the upgrade. ESLint's existing warning policy is likewise retained in #4302. Validation: both packages pass Solidity lint and formatting/config checks. Targeted probes confirm missing state visibility still fails, valid source passes, and event naming remains a warning. No contract or TypeScript source changes are included. The preceding stack passed strict typechecks, prepack, fresh TypeChain generation, full lint, comparison of all 159 contract ABIs/runtimes and emitted JavaScript, and both functional suites (955 beacon and 673 ECDSA, 44 existing pending).
Both Solidity packages now use Prettier 3 and prettier-plugin-solidity 2, with explicit plugin loading and `trailingComma: "all"`. ECDSA's shell-formatting plugin is updated to the compatible line. The first commit contains only dependency/configuration changes; the second contains only formatter output. Part of #4214; stacked on #4302 (ESLint 10). Solhint 6 follows in the final toolchain PR. This stack builds on #4208; stacked-branch CI is addressed by #4217, and Node 24 rollout by #4205. Validation on Node 24.11.1: - Both packages pass a forced Solidity rebuild with the generated TypeChain directories removed, strict typechecks, prepack, and full lint. - All 159 compiled contract ABIs and deployed runtime bytecodes are identical to the baseline after stripping Solidity metadata. Both packages regenerate TypeChain successfully with Prettier 3 installed (166 beacon and 218 ECDSA typings). - All 108 reformatted TypeScript files preserve emitted JavaScript apart from whitespace. - The prerequisite functional stack passed all 955 beacon and 673 ECDSA tests (44 existing pending). The formatting-only changes are additionally covered by the ABI/runtime and JavaScript comparisons above.
piotr-roslaniec
merged commit Sep 13, 2026
bbda6be
into
codex/beacon-hardhat-verify
17 checks passed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Both Solidity packages depended on a Git-pinned ESLint configuration that cannot support the current ESLint line. This migrates them to ESLint 10 flat configs with typescript-eslint 8, import-x, and the focused-test guard, and removes the shared config dependency.
The flat configs carry forward the existing active non-React lint policy, including package-specific overrides and the existing warning severities. Prettier runs as a separate formatting check. Generated files are ignored; the auxiliary ECDSA script remains covered by a dedicated lint TypeScript project. Obsolete directives and import styles are updated without changing contract behavior.
Part of #4214; stacked on #4301. Prettier 3 and Solhint 6 follow separately so their dependency and formatting changes can be reviewed independently. This stack builds on #4208; #4217 enables CI for the stacked branch bases, and the runtime rollout is tracked by #4205.
Validation (Node 24.11.1): both packages pass their full lint commands, strict typechecks, and prepack builds. ESLint probes confirm authored tests are checked, generated output is ignored, focused Mocha tests fail, and ordinary tests pass. TypeScript emit comparison found only ordered task-registration imports, a built-in fs import hoist, and a Chai import reorder beyond comment/format changes; both full test suites passed on the prerequisite stack (955 beacon, 673 ECDSA, 44 existing pending).
Review follow-up
lint:eslint(renamedlint:ts) now also runsprettier --checkover JS/TS/MJS/CJS files. Previously only.soland.json/.yamlwere Prettier-checked in either package, so this is net-new enforcement, not a pre-existing check that moved.solidity/eslint.rules.cjs(build: migrate Solidity tooling to ESLint 10 tbtc-v2#1132); doing the same here is a reasonable follow-up if these configs need to stay in sync going forward, but is out of scope for this migration.@thesis-co/eslint-configsource, including thedisallowArithmeticOperatorsoption onno-unsafe-optional-chaining); added a committed ESLint policy regression test per package (assertsno-only-testsfires,typechain/**stays ignored, ordinary test files are actually linted); made random-beacon'sno-await-in-loop: offexplicit instead of silently unconfigured; and removed a stale npm lockfile still referencing the removed tarball dependency.