#26: deep-nesting smell (TS, ESLint max-depth) — #24's live demonstrator - #40
Merged
Conversation
devill
force-pushed
the
issue-24-smell-agnostic
branch
from
June 17, 2026 15:26
067a3ed to
bff09dc
Compare
only the catalogue (source eslint, sourceRuleId max-depth) — the eslint translation and preset produces auto-derive via #24, so the runner, sensors, checks, and registry need zero edits. Ships a ROSE-pattern prompt and an end-to-end test that fires it through the real runner. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nq6xHU6JtSNpYWhMYjXB15
`max-depth: 4` rule alongside the other thresholds, so deep-nesting is configurable from the eslint config like the other TS smells. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nq6xHU6JtSNpYWhMYjXB15
devill
force-pushed
the
issue-26-deep-nesting
branch
from
June 17, 2026 15:36
b0e9aef to
35328cb
Compare
devill
marked this pull request as ready for review
June 17, 2026 15:36
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.
Closes #26. Stacked on #24 (
issue-24-smell-agnostic) — it is #24's live demonstrator.Adds a
deep-nestingsmell (TypeScript via ESLint coremax-depth): deeply nested blocks that want guard clauses, early returns, or an extracted helper.This is the #24 proof
After #24 made the sensor layer smell-agnostic, adding
deep-nestingtouches onlysrc/config/andsrc/cli/init/:The eslint raw→smell translation and the preset's
producesauto-derive from the catalogue (via #24'stool-smells.ts) — zero edits to the runner, sensors, checks, or rules registry.Changes
src/config/catalogue.ts: thedeep-nestingrule (source: eslint,sourceRuleId: max-depth, enforced, changed-files-only — mirrorshigh-complexity).src/cli/init/templates/eslint-config.ts: scaffolds a tunablemax-depth: 4.src/prompts/deep-nesting.md: ROSE-pattern prompt (guard clauses → extract helper → replace structure).docs/smell-vocabulary.md: catalogue + TS translation tables, and the TS/Python asymmetry (ruffPLR1702is preview/unstable → Python deferred).Scope
TypeScript only; Python deferred (don't opt the default preset into ruff
--preview).Tests
End-to-end through the real runner: a 5-deep nested file fires
deep-nestingatmax-depth: 2and does not atmax-depth: 6(proving consumer-configurability). Init scaffold test assertsmax-depth: 4.Gates
pnpm build,pnpm lint— clean (catalogue.tsat the 200-line cap)pnpm test— 390 passed🤖 Generated with Claude Code
Generated by Claude Code