Skip to content

feat: enable type-aware linting and type checking - #3

Open
fengmk2 wants to merge 2 commits into
migrate-to-vite-plusfrom
enable-type-aware-lint
Open

feat: enable type-aware linting and type checking#3
fengmk2 wants to merge 2 commits into
migrate-to-vite-plusfrom
enable-type-aware-lint

Conversation

@fengmk2

@fengmk2 fengmk2 commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

OpenSpec

  • This PR implements an OpenSpec change: <!-- change name -->
  • No OpenSpec change is needed (small doc/fix, no shipped behavior change).

Verification

  • pnpm verify passed.
  • A subset was run instead: <!-- commands --> because <!-- reason -->.

Impact Checklist

  • App code (apps/, packages/)
  • API behavior / OpenAPI contract (apps/api/src/routes/*.ts zod-openapi declarations, api/openapi.json via pnpm gen:openapi)
  • Database schema or migration (packages/db)
  • Deployment (deployment/)
  • Documentation (README.md, docs/, wiki/)
  • CI / scripts (.github/workflows/, scripts/, package.json)
  • Secret handling: no real .env, tokens, cookies, private keys, database URLs, or user data committed.

Migration / Deployment Notes

fengmk2 added 2 commits August 5, 2026 15:54
Turn on lint.options.typeAware and typeCheck in vite.config.ts and fix
everything they surfaced:

- void 58 floating promises across web routes and stores; restructure
  destructures flagged by unbound-method
- retype useState<any> and redundant any unions with real DTO types
- narrow unknown values before stringification in the mongo migration
  script and the moderation scan decoder
- give package tsconfigs explicit rootDir (or noEmit for @cnode/db) so
  tsgolint can type-check each project; apps/api keeps its existing
  nested dist layout
- declare *.css modules for side-effect imports in apps/web
- upgrade TypeScript to 7.0.2 and @types/node to 24 to match Node 24

Typing @cnode/db's DB export (currently any) surfaces ~40 more type
errors in @cnode/api, including likely real bugs in message rendering
(topic.author does not exist on the row type); left as a follow-up,
see the TODO in packages/db/src/client.ts.
Type-aware lint reads apps/web/.react-router/types, which only existed
after running typecheck or dev. CI runs pnpm verify (lint first) on a
fresh checkout, so vp lint failed with 15 missing-module errors. Run
react-router typegen as apps/web postinstall so the generated types
exist right after pnpm install.
@fengmk2
fengmk2 force-pushed the enable-type-aware-lint branch from 85d1c79 to bc30e2e Compare August 5, 2026 07:55
@fengmk2
fengmk2 marked this pull request as ready for review August 5, 2026 08:35
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