Skip to content

Enable tsconfig strict mode + reduce usage #4

Description

@loadfix

Context

xlsxjs has ~58 `any` hits across 21 source files — concentrated in `workbook-parser.ts` (22), `html-renderer.ts` (10), `number-format.ts` (8).

All three JS renderers run `tsconfig.json` with `strict: (unset)` and `noImplicitAny: false`. Across the trio, pptxjs is the clean outlier (~3 `any`s); docxjs and xlsxjs both have meaningful surface area.

Expected approach

  1. Ratchet file: commit `.any-budget` listing current counts per file. CI guards against regression. Contributors may NOT introduce new `any` without reducing another.
  2. Gradual typing: review the 58 sites. Cluster: formula-eval (`AST` handling), workbook-parser (untyped XML traversal), html-renderer (DOM manipulation). Replace easy ones with `unknown` + refinement, or explicit type definitions.
  3. Flip noImplicitAny: true once count drops below (say) 20.
  4. Flip strict: true once count hits 0.

See also

  • Same issue open on docxjs
  • pptxjs is the target standard (strict=true feasible today)

Surfaced by: 2026-05-05 consistency audit (item 10).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions