Skip to content

Quality gates do not reliably catch TypeScript violations #182

@imdhemy

Description

@imdhemy

Problem

The current quality gates do not reliably catch TypeScript violations.

npm run lint runs ESLint, but ESLint is not configured with type information. It uses typescript-eslint recommended rules, but not the type-checked configs, and it does not consume tsconfig.eslint.json.

npm run build runs tsc, but tsconfig.json only includes src/**/*.ts and src/**/*.d.ts, so tests, E2E tests, and root config files are not part of the build type-check surface.

CI runs lint, format, tests, build, and export checks, but those checks inherit the same blind spots.

Evidence

  • npm run lint only runs eslint . from package.json.
  • eslint.config.ts uses typescript-eslint recommended rules, but not type-aware rules, and does not connect to tsconfig.eslint.json through parserOptions.project or projectService.
  • tsconfig.eslint.json includes tests, but nothing appears to consume it from ESLint or package scripts.
  • npm run build runs tsc && tsc-alias, but the main tsconfig.json includes only source files.
  • npm run test runs Vitest with coverage, but Vitest execution is not a substitute for full TypeScript checking of all project files.
  • Config files are explicitly ignored by ESLint via *.config.js and *.config.ts, which excludes important tool configuration from linting.
  • CI runs the existing scripts, so CI inherits the same coverage gaps.

Proposed solution

Add a dedicated type-check gate and make ESLint type-aware in the same PR.

1. Add npm run typecheck

Create a type-check-only tsconfig that includes:

  • src/**/*.ts
  • src/**/*.d.ts
  • tests/**/*.ts
  • relevant root config files such as eslint.config.ts and vitest.config.ts

Add a package script similar to:

{
  "typecheck": "tsc --noEmit -p tsconfig.typecheck.json"
}

Then add npm run typecheck to CI as a separate step.

2. Make ESLint type-aware

Update eslint.config.ts to use the type-checked typescript-eslint config and point it at the project type-check config.

The goal is for ESLint to catch semantic TypeScript risks such as unsafe assignments, unsafe calls, floating promises, and misused promises, not only syntax-level or style-level issues.

3. Stop hiding quality-tool config files

Do not broadly ignore *.config.ts from ESLint unless there is a documented reason. Tooling configuration is part of the quality system and should be checked.

4. Strengthen release safety

CD currently builds and publishes. It should either depend on passing CI or run the critical quality gates before publish, including typecheck.

Acceptance criteria

  • npm run typecheck exists and checks source, tests, E2E tests, and relevant config files.
  • npm run lint uses type-aware TypeScript ESLint rules.
  • CI runs typecheck as a separate step.
  • Config files are no longer silently excluded from lint/typecheck coverage.
  • Any existing violations discovered by the stricter gates are fixed in the same PR.

Notes

This should be handled as quality-gate hardening, not as broad cleanup. If enabling type-aware ESLint exposes many existing violations, fix only the violations required to make the new gates pass and leave unrelated style cleanup out of scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions