Skip to content

core: tsconfig.json excludes test files, breaking eslint #441

@bpowers

Description

@bpowers

Problem

src/core/tests/datamodel.test.ts fails eslint with:

parserOptions.project has been provided for @typescript-eslint/parser. The file was not found in any of the provided project(s).

The @simlin/core package's tsconfig.json does not include test files in its include or files configuration. Because @typescript-eslint/parser is configured with parserOptions.project pointing to this tsconfig, it cannot perform type-aware linting on any test files.

Why it matters

This blocks the pre-commit hook for ALL commits, regardless of which files are changed. The hook runs TypeScript linting across the workspace, which includes src/core/tests/, and the parser error causes a hard failure.

Component(s) affected

  • src/core (tsconfig.json configuration)
  • Pre-commit hook (scripts/pre-commit)

Possible approaches

  1. Add a tsconfig.test.json that extends tsconfig.json and includes the tests/ directory, then configure the eslint override for test files to use it.
  2. Add tests/**/*.ts to the existing tsconfig.json include array.
  3. Configure eslint to use a separate parser options project for test files.

Option 2 is simplest but may pull test types into the production build. Option 1 is the standard pattern for TypeScript projects that separate test and production compilation.

Context

Identified as a pre-existing infrastructure issue blocking the pre-commit hook for all commits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciCI, build pipeline, test hygiene

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions