mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-04-17 13:21:31 +00:00
2.8 KiB
2.8 KiB
Phase 05 — JSDoc Pass Report
Date: 2026-04-15 Phase: phase-05-jsdoc-pass Plan: plans/260415-1010-d1-cron-infra/
Files Modified
| File | Change |
|---|---|
package.json |
Added eslint ^10.2.0, eslint-plugin-jsdoc ^62.9.0 devDeps; updated lint script |
eslint.config.js |
Created — flat config, JSDoc-only rules, definedTypes for CF/custom globals |
src/types.js |
Created — central typedef module: Env, Command, Cron, ModuleContext, Module, Trade + re-exports of KVStore, SqlStore, Portfolio |
src/db/kv-store-interface.js |
Object → object in all typedefs |
src/db/sql-store-interface.js |
Object → object in all typedefs |
src/modules/registry.js |
Object → object; fixed invalid TS destructure syntax in init property type |
src/modules/validate-command.js |
Object → object |
src/modules/validate-cron.js |
Object → object (Phase 02 owns impl; only typedef fixed) |
src/modules/trading/portfolio.js |
Object → object |
src/modules/trading/symbols.js |
Object → object |
src/modules/index.js |
Removed {@link loadModules} curly-brace syntax misread as a type |
Files already fully annotated (no changes needed): src/index.js, src/bot.js, src/db/cf-kv-store.js, src/db/create-store.js, src/db/cf-sql-store.js, src/db/create-sql-store.js, src/modules/dispatcher.js, src/modules/trading/handlers.js, src/modules/trading/prices.js, src/modules/trading/format.js, src/modules/trading/stats-handler.js.
Tasks Completed
- Install
eslint,eslint-plugin-jsdoc eslint.config.jswith JSDoc-only rules- Update
lintscript src/types.jscentral typedef file- All targeted files annotated / typedef-corrected
npm run lint— clean (Biome + ESLint both exit 0)
Tests Status
- Biome: pass
- ESLint: pass (0 errors, 0 warnings)
- Unit tests: 139/139 pass (14 test files)
Issues Encountered
eslint-plugin-jsdocusesdefinedTypes(rule option) notdefinedNames(settings key) — corrected ineslint.config.js.- Several files had CRLF endings introduced by
nodescript edits — resolved viabiome format --write. {@link loadModules}inside@fileJSDoc was parsed as a type reference by the plugin — removed curly braces.- Registry
BotModule.initused TypeScript destructure syntax({ db, sql, env }: {...})whichjsdoc/valid-typesrejects — changed to plain(ctx: {...}) => Promise<void>. validate-cron.jsis Phase 02-owned but had anObjecttypedef that caused lint errors — fixed only the typedef line (no logic changes).
Status: DONE
Summary: npm run lint exits 0 (Biome + ESLint clean), 139 tests pass, no runtime changes. Central src/types.js typedef file created; all JSDoc issues corrected across 11 files.