chore(cactus-plugin-satp-hermes): add dead code detection rules to eslint config#4382
Conversation
4cbd34e to
7fd43e9
Compare
|
@bhavyamsharmaa thank you for your contribution. Could you indicate what is the output of the linter given the changes? Based on that, what would be the approach to apply changes to the codebase cautiously? |
|
Hi @RafaelAPB — here's the linter output after the new rules + follow-up fixes: Before this update: 170 problems (32 errors, 138 warnings) |
60aa1a6 to
9114c68
Compare
RafaelAPB
left a comment
There was a problem hiding this comment.
@bhavyamsharmaa thank you for your contribution. This is very useful and needed.
The new config seems good. Could you please also 1) add a SATP lint stage to the CI that enforces that codebase passes linter , 2) add the linter to the commit hooks (pre push), and 3) resolve warnings?
| try { | ||
| //todo | ||
| return true; | ||
| } catch (err) { |
There was a problem hiding this comment.
please comment instead of deleting; we will need this code
- Add no-unreachable (error), no-unused-private-class-members (warn), and @typescript-eslint/no-unused-expressions (warn) rules to eslint.config.mjs for dead code detection - Add Node.js globals override for *.mjs files - Add lint:ci npm script for CI linting without auto-fix - Add SATP lint stage to satp-hermes-build.yaml CI workflow - Add pre-push git hook that runs the SATP linter - Restore deleted catch block as commented-out code in stage1-client-service.ts (will be uncommented when logic is added) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9114c68 to
e6b2c4d
Compare
|
Hi @RafaelAPB, addressed all your comments: Restored the catch block as a comment in stage1-client-service.ts (not deleted) so it's easy to uncomment once the //todo logic is done. Squashed everything into one commit. |
Closes #4374
What changed
Added three rules to
packages/cactus-plugin-satp-hermes/eslint.config.mjs:no-unreachable(error) — flags code afterreturn/throw/breakthat can never runno-unused-private-class-members(warn) — flags private class fields that are never read@typescript-eslint/no-unused-expressions(warn) — flags expressions with no side effectsWhy this approach
The issue mentions two paths: migrate to Biome, or improve ESLint. Biome migration was noted to risk linting inconsistency across the 90+ packages in the monorepo. This PR takes the incremental path — adds dead code detection to the existing config without touching any other package or adding new dependencies.
Testing
Config change only. Existing
format:eslintscript picks up the new rules automatically.Assisted-by: anthropic:claude-sonnet-4-6