Skip to content

[OP-17736] route spec files via solution-style root config#23906

Open
akabiru wants to merge 3 commits into
devfrom
chore/frontend-tsconfig-solution-style
Open

[OP-17736] route spec files via solution-style root config#23906
akabiru wants to merge 3 commits into
devfrom
chore/frontend-tsconfig-solution-style

Conversation

@akabiru

@akabiru akabiru commented Jun 24, 2026

Copy link
Copy Markdown
Member

https://community.openproject.org/wp/OP-17736

Opening a *.spec.ts in an editor surfaces phantom Cannot find name 'describe' / 'it' / 'expect' errors. The TypeScript language server resolves a file against the nearest tsconfig.json, and the frontend root config declared no files or include, so it globbed spec files in without the vitest/globals types that tsconfig.spec.json provides.

This restores the Angular CLI default solution-style root config (files: [] plus references to the app and spec projects) so the language server routes each file to the project that owns it. The app project's include is broadened to the whole src tree (excluding specs and the Vitest entry files) so every non-spec file still belongs to a project — without this, ESLint's projectService can no longer resolve most of src/app.

Broadening the app include compiles the whole tree, which surfaces two dead, unreferenced components that no longer build (GlobalSearchTabsComponent, ViewSettingsModalComponent); both are removed. The unused tsconfig.compodoc.json (referenced nowhere) is dropped as well.

The root frontend/tsconfig.json globbed spec files without vitest
globals, so editors flagged phantom describe/it/expect errors. Add
files:[] and references to the app and spec projects, matching the
Angular CLI default, so each file resolves under its owning project.
@akabiru akabiru marked this pull request as ready for review June 24, 2026 08:30
@akabiru akabiru requested a review from myabc June 24, 2026 08:30
@akabiru

akabiru commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@myabc This mainly would affect nvim users as the rootdir changes in context of the buffer: i.e. when within the frontend/ dir- the first root is seen as that which messes up the TS language server to show erroneous errors

EDIT: affects any editor whose TS language server resolves a file against the nearest tsconfig.json (VS Code, Zed, nvim).

@akabiru akabiru added javascript Pull requests that update Javascript code eslint labels Jun 24, 2026

@myabc myabc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

I missed this when switching us over to Vitest.

@myabc myabc changed the title Chore/frontend-tsconfig: route spec files via solution-style root config [OP-17736] route spec files via solution-style root config Jun 24, 2026
@myabc

myabc commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@akabiru we should be able to delete frontend/tsconfig.compodoc.json. It's not referenced anywhere.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the frontend TypeScript configuration to use a solution-style root tsconfig.json so editors/tsserver route *.spec.ts files to tsconfig.spec.json (with vitest/globals), avoiding phantom “Cannot find name 'describe'/'it'/'expect'” diagnostics.

Changes:

  • Convert frontend/tsconfig.json to a solution-style root config (files: [] + references to app/spec projects).
  • Broaden frontend/tsconfig.app.json include/exclude patterns to ensure non-spec files are owned by the app project while excluding *.spec.ts.
  • Remove frontend/tsconfig.compodoc.json and delete an unused(?) global search tabs component file.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
frontend/tsconfig.json Adds files: [] and project references to route files to the correct TS project in editors.
frontend/tsconfig.app.json Expands include/exclude globs to make the app project “own” src/** while excluding specs.
frontend/tsconfig.compodoc.json Deletes the compodoc-specific tsconfig file.
frontend/src/app/core/global_search/tabs/global-search-tabs.component.ts Deletes the global search tabs component source file.

Comment thread frontend/tsconfig.app.json
Comment thread frontend/tsconfig.json
myabc added 2 commits June 24, 2026 12:39
Root tsconfig is solution-style, so the narrow app include left most
src files in no TS project and broke ESLint's projectService coverage.

Widening the include compiles the whole tree, which surfaces two dead,
unreferenced components that no longer build; both are removed.

https://community.openproject.org/wp/OP-17736
Removes eslint-disable directives and `as any` casts that no longer
suppress any violation, and the import left unused by a dropped cast.
@myabc myabc force-pushed the chore/frontend-tsconfig-solution-style branch from 25def98 to c148641 Compare June 24, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eslint javascript Pull requests that update Javascript code

Development

Successfully merging this pull request may close these issues.

3 participants