Skip to content

fix: resolve ESLint/Stylelint warnings and stale docs#158

Merged
YusukeHirao merged 6 commits into
devfrom
fix/lint-warnings
Jul 3, 2026
Merged

fix: resolve ESLint/Stylelint warnings and stale docs#158
YusukeHirao merged 6 commits into
devfrom
fix/lint-warnings

Conversation

@YusukeHirao

@YusukeHirao YusukeHirao commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix ~80 ESLint warnings (jsdoc/no-undefined-types, no-console, @typescript-eslint/consistent-type-imports, react-hooks/exhaustive-deps) and 4 Stylelint warnings across crawler/query/report-google-sheets/viewer, by fixing the actual root cause of each rather than suppressing (see per-commit messages for the mechanism behind the jsdoc/no-undefined-types fixes).
  • Along the way, fixed two real doc bugs found by the linter: page.ts referenced JSDoc methods that had been renamed to getJsonLd/getTags, and crawler.ts had an orphaned JSDoc block left behind by a prior refactor.
  • Added exclude: ["node_modules", "**/*.d.ts"] to the root tsconfig.json — it had none, so type-aware ESLint was also parsing every package's compiled lib/*.d.ts output alongside its source (~30% of the program's files), inflating peak memory ~18% for no benefit.
  • Fixed stale counts and dead references in ARCHITECTURE.md (MCP tool count, CLI subcommand count, viewer route count, a nonexistent crawler/utils/url/ directory reference, two deleted benchmark scripts) and a CONTRIBUTING.md compatibility-policy note that contradicted actual 0.x release practice.
  • The two remaining react-hooks/incompatible-library warnings (TanStack Table + React Compiler) are left as-is — verified benign, no local fix exists short of an upstream TanStack Table change.

Test plan

  • yarn lint:check — exit 0 (only the two accepted TanStack Table warnings remain)
  • yarn build (via direct tsc --build per package + vite build for viewer, verified to defeat the sandbox's known lerna run build no-op) — all 14 packages + viewer frontend build clean
  • yarn vitest run — 254/254 test files, 2151/2156 tests passed (5 pre-existing skips)

🤖 Generated with Claude Code

Root tsconfig had no exclude, so type-aware ESLint swept up every
package's compiled lib/*.d.ts alongside its src/*.ts (30% of the
program's files), inflating peak memory ~18% for no benefit. Follows
the pattern already used in the kamado sibling repo.

Also fixes documentation drift found while investigating: stale
tool/subcommand/route counts and dead file references in
ARCHITECTURE.md, and a compatibility-policy note in CONTRIBUTING.md
that contradicted actual 0.x release practice.
eslint-plugin-jsdoc's no-undefined-types rule cannot verify {@link}
targets that point across files without an import, or at private
class members, so it flagged ~40 cross-references throughout the
package. Fixed each by qualifying same-file references as
ClassName.member, converting cross-file/cross-package references to
`import('./file.js').symbol` or backtick text, and adding
eslint-disable-next-line for the one intentional operator-facing
console.warn.

Also fixes two real doc bugs found in the process: page.ts referenced
methods renamed to getJsonLd/getTags, and crawler.ts had an orphaned
JSDoc block left behind when _launchBrowserAndScrape moved.
Same root cause as the crawler fix: {@link} targets that eslint-jsdoc
can't verify (cross-file symbols, or an inline `import('...').Type`
where a top-level import type already exists). Also flags two
intentional console.warn calls (malformed responseHeaders/meta_extras
JSON) as such.
- Resolve unreachable JSDoc {@link} references (same pattern as
  crawler/query)
- Convert vi.importActual<typeof import(...)> to a top-level
  import type * as NS plus typeof NS, in the three cache spec files
- pages-view.tsx: hoist the dynamic filter[key] access into a locally
  built object so react-hooks/exhaustive-deps can see the full
  dependency set instead of demanding the whole filter object
- styles.css: replace hardcoded #fff with var(--text-on-accent), a 6ch
  width with 3.5em, and `display: block` with the two-keyword
  `block flow` syntax
@YusukeHirao YusukeHirao merged commit 91009ad into dev Jul 3, 2026
10 checks passed
@YusukeHirao YusukeHirao deleted the fix/lint-warnings branch July 3, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant