[OP-17736] route spec files via solution-style root config#23906
[OP-17736] route spec files via solution-style root config#23906akabiru wants to merge 3 commits into
Conversation
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.
|
@myabc EDIT: affects any editor whose TS language server resolves a file against the nearest tsconfig.json (VS Code, Zed, nvim). |
myabc
left a comment
There was a problem hiding this comment.
Looks good!
I missed this when switching us over to Vitest.
|
@akabiru we should be able to delete |
There was a problem hiding this comment.
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.jsonto a solution-style root config (files: []+referencesto app/spec projects). - Broaden
frontend/tsconfig.app.jsoninclude/exclude patterns to ensure non-spec files are owned by the app project while excluding*.spec.ts. - Remove
frontend/tsconfig.compodoc.jsonand 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. |
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.
25def98 to
c148641
Compare
https://community.openproject.org/wp/OP-17736
Opening a
*.spec.tsin an editor surfaces phantomCannot find name 'describe' / 'it' / 'expect'errors. The TypeScript language server resolves a file against the nearesttsconfig.json, and the frontend root config declared nofilesorinclude, so it globbed spec files in without thevitest/globalstypes thattsconfig.spec.jsonprovides.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'sincludeis broadened to the wholesrctree (excluding specs and the Vitest entry files) so every non-spec file still belongs to a project — without this, ESLint'sprojectServicecan no longer resolve most ofsrc/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 unusedtsconfig.compodoc.json(referenced nowhere) is dropped as well.