Repository navigation
eslint: no-explicit-any -> error; +husky pre-commit (lint only); config cleanups - #22
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrVv49ZydmFUGUVbVTGWeN
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrVv49ZydmFUGUVbVTGWeN
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrVv49ZydmFUGUVbVTGWeN
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrVv49ZydmFUGUVbVTGWeN
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrVv49ZydmFUGUVbVTGWeN
|
Review: eslint no-explicit-any -> error; husky pre-commit (lint only); config cleanups Overall this is a clean, well-scoped tooling PR. Three independent, low-risk changes bundled together, each explained clearly in the PR body with verification steps. Nice attention to detail on the lint-staged gotchas (function-form config for 1. no-explicit-any: error
2. Husky + lint-staged pre-commit hook
3. Config cleanups
Security Test coverage Summary |
9.x/17.x floor node at 22.22, breaking our engines ">=22" (hard fail once engine-strict lands). Newest versions satisfied by 22.0.0: npm-run-all2@8.0.4 (^20.5.0 || >=22.0.0), lint-staged@16.4.0 (>=20.17). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrVv49ZydmFUGUVbVTGWeN
Joining with spaces broke on filenames containing spaces (lint-staged spawns without a shell, so the command string is arg-split on whitespace). Quote each via JSON.stringify; `--` guards a leading `-`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrVv49ZydmFUGUVbVTGWeN
ReviewOverviewThree related dev-tooling changes: (1) flips Code quality & style
Potential issues / risks
Test coverageNo new automated tests, which is appropriate here — this is dev-tooling/config, not application logic. The PR description documents manual verification (throwaway staged probes for SecurityNo concerns. SummarySolid, low-risk tooling PR with good documentation of rationale and verification. The 🤖 Generated with Claude Code |
👋 Claude here — three related changes to tighten the dev loop.
1.
no-explicit-any:off→errorFlipped
@typescript-eslint/no-explicit-anyto"error"and refreshed the surrounding comments, which framed the whole block as overrides that "ease getting into TypeScript, can be removed for stricter linting." That framing is no longer true forno-explicit-any, so it now reads "several rules below are relaxed…" and the honest framing is kept for the rules that remain relaxed (no-unused-varsas warn, theno-unsafe-*group,require-await).Did it surface real
anyusages? No. The only explicitanyin the repo is insrc/routeTree.gen.ts(generated by the TanStack Router plugin), which starts with/* eslint-disable */and is not linted.pnpm lintpasses with zero changes to app code — noeslint-disabledodges were needed.While in that block I also fixed an adjacent stale comment:
ban-ts-commentis set to"error"but was labelled// Allow escaping the compiler(the opposite of what"error"does).2. Pre-commit hook — lint only, never formatting
Added
husky+lint-staged(pnpm exec husky initwired theprepare: huskyscript and.husky/)..husky/pre-commitrunspnpm exec lint-staged. On staged*.{ts,tsx},lint-staged.config.js:eslint --max-warnings 0on the staged files, andtsc -bto type-check the whole project.No formatter runs in the hook. Two implementation notes, both from the lint-staged docs:
tsc -b: build mode rejects file arguments, so it must run project-wide, not per-file.eslintgets--no-warn-ignored. The*.{ts,tsx}glob matches by basename, so staging e.g.vite.config.ts(which eslint ignores) would otherwise emit a "file ignored" warning and fail under--max-warnings 0. This is the documented fix for ESLint flat config ≥ 8.51.0.3. Config cleanups
package.jsonlintscript: dropped the dead--ext ts,tsxflag (a no-op under ESLint flat config).npm-run-allwith the maintained forknpm-run-all2;devnow uses itsrun-pbinary.vite.config.ts: addedserver.strictPort: trueso a busy 5173 fails loudly instead of silently drifting to 5174.Verification
pnpm install --frozen-lockfile— up to datepnpm lint— passpnpm build— pass (pre-existing chunk-size warning only)pnpm test— 5 passedanyfile was blocked by eslint; an eslint-clean file with a type error was blocked bytsc -b. A clean commit passes through.🤖 Generated with Claude Code
https://claude.ai/code/session_01VrVv49ZydmFUGUVbVTGWeN