Skip to content

Resolve all ESLint warnings, improve strict typing, fix knip issues, and enhance TypeDoc/reporting configuration #2276

@pethers

Description

@pethers

📋 Issue Type

Code Quality / Tooling

🎯 Objective

Achieve zero-warning ESLint compliance, eliminate all any types, resolve knip dead-code findings, fix TypeDoc configuration issues, and improve all reporting (coverage, API docs, dependency reports).

📊 Current State

  • ESLint @typescript-eslint/no-explicit-any is set to warn — many existing usages across scripts/ and src/
  • no-unused-vars is warn for JS files — unchecked violations
  • knip.json has ignoreDependencies and ignoreBinaries workarounds rather than proper resolution
  • typedoc.json entry points include js/ directory (mixed JS/TS documentation)
  • tsconfig.typedoc.json may have configuration mismatches causing documentation gaps
  • Test coverage reporting (vitest run --coverage) output not fully integrated into docs
  • Dependency report generation (docs:dependencies script) uses placeholder patterns

🚀 Desired State

ESLint

  • Zero warnings on npm run lint — all warn rules promoted to error or violations fixed
  • @typescript-eslint/no-explicit-anyerror (all any replaced with proper types)
  • no-unused-varserror for remaining JS files
  • Add @typescript-eslint/strict-boolean-expressions as warn for improved type safety
  • Add @typescript-eslint/no-floating-promises for async safety

Strict Typing

  • All function parameters and return types explicitly typed
  • No any in scripts/, src/browser/, or tests/
  • Shared type definitions in scripts/types/ for common data structures
  • Proper generic types for MCP client responses, IMF data, CIA schemas

Knip Configuration

  • Remove items from ignoreDependencies that can be properly resolved
  • Ensure all entry points are correctly declared
  • Zero knip violations on npx knip
  • Add scripts/render-lib/**/*.ts, scripts/generate-news-indexes/**/*.ts, scripts/rss/**/*.ts, scripts/sitemap-html/**/*.ts, scripts/sitemap-xml/**/*.ts to entry points if missing

TypeDoc

  • Fix typedoc.json to exclude legacy js/ if not properly documented
  • Validate tsconfig.typedoc.json includes all relevant source paths
  • Ensure generated API documentation at docs/api/ is complete and navigable
  • Custom block tags (@osint, @intelligence, @parliament, etc.) properly rendered
  • All public functions have JSDoc with @param, @returns, @example

Reporting

  • npm run coverage produces HTML report usable in CI
  • npm run docs:dependencies produces valid dependency tree
  • npm run typedoc runs without errors or warnings
  • Test result reports properly formatted for CI artifacts

🔧 Implementation Approach

  1. Run npm run lint and categorize all warnings by type/file
  2. Fix no-explicit-any violations — define interfaces for common shapes (IMF data, MCP responses, CIA schemas, article metadata)
  3. Fix unused variable warnings in JS files
  4. Review and update knip.json entry points and project patterns
  5. Run npx knip and resolve all findings (remove dead exports, fix dependency declarations)
  6. Fix typedoc.json configuration — validate against current source layout
  7. Add missing JSDoc to public APIs
  8. Validate all reporting scripts produce clean output

📚 Key Files

File Purpose
eslint.config.js ESLint flat config — rules to tighten
knip.json Knip dead-code detection config
typedoc.json API documentation generator config
tsconfig.typedoc.json TypeScript config for documentation
tsconfig.scripts.json TypeScript config for scripts
tsconfig.lib.json TypeScript config for library build
package.json Script definitions for lint/docs/coverage
scripts/types/ Shared type definitions
scripts/imf-client.ts Example of large file needing type improvements
scripts/render-lib/ Render library modules

✅ Acceptance Criteria

  • npm run lint exits with 0 and zero warnings
  • Zero any types in scripts/**/*.ts and src/**/*.ts
  • npx knip exits with 0 findings
  • npm run typedoc completes without errors
  • Generated API docs include all public modules with proper JSDoc
  • npm run coverage produces valid HTML report
  • All 3,319+ existing tests continue to pass
  • npm run build succeeds without type errors
  • npm run build:lib succeeds for library package

🤖 Recommended Agent

code-quality-engineer — ESLint configuration, TypeScript strict typing, dead-code analysis, documentation tooling

🏷️ Labels

enhancement, refactor, component:quality-assurance, priority-high, size-l

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions