Skip to content

Fix pre-existing JSDoc/type gaps in src/index.mjs, then add a real test:types check #5

Description

@Shinrai

Found while onboarding the v4 CI/release flow (#2) — out of scope for that change, filing separately.

.configs/tsconfig.types.jsonc (used by build:types) runs with checkJs: false — it emits .d.mts declarations from the JSDoc annotations in src/index.mjs but never verifies them. Running the same file through tsc with checkJs: true (no emit) surfaces ~10 pre-existing errors against prettier's plugin API, e.g.:

src/index.mjs(125,22): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'CallCallback<any, Doc>'.
src/index.mjs(200,6): error TS2322: Type 'unknown' is not assignable to type '2025 | 2011 | ... | 2024'.
src/index.mjs(219,29): error TS2341: Property 'tokens' is private and only accessible within class 'Parser'.
src/index.mjs(228,14): error TS2339: Property 'comments' does not exist on type 'Program'.

Mostly path.call(print, ...) / path.map(print, ...) callbacks typed as bare Function instead of prettier's CallCallback/MapCallback signatures, a couple of options.jsonvYear/options.strictBigInt reads typed as unknown, and two accesses into @cldmv/jsonv's Parser internals (parser.tokens, program.comments) that aren't part of its public typed surface.

This is why CI (.github/workflows/ci.yml, added in #2) sets skip_type_check: true rather than wiring a real test:types script — a real checkJs pass would fail on these pre-existing gaps, unrelated to the CI onboarding change. Once these are fixed, add a .configs/tsconfig.check.jsonc (checkJs: true, noEmit: true) + "test:types" script and flip skip_type_check to false in ci.yml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions