Skip to content

TypeScript plugin reports false errors for test files in standalone mode #1201

@hanna-skryl

Description

@hanna-skryl

What happened?

When running the TypeScript plugin in standalone mode, test files produce misleading semantic errors like Cannot find name 'describe'. or Cannot find name 'expect'.

This resulted in 2581 semantic errors across all test files in the workspace.

The TypeScript plugin in standalone mode uses tsconfig.base.json directly, which doesn't include vitest/globals in its types. Project-level tsconfig.test.json files do have the correct types configured, but the plugin never sees them.

What would you expect to happen?

Test files should be analyzed with their proper type definitions, or excluded from analysis.

What steps did you take?

  1. Ran npx nx run workspace:code-pushup --onlyPlugins=typescript
  2. The TypeScript plugin used tsconfig.base.json as configured in the preset
  3. Test files were analyzed without Vitest type definitions

Code PushUp package version

0.100.1

What operation system are you on?

MacOS

Node version

24.8.0

Relevant log output

Error: TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Error: TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions