While working on Angular testing, I encountered an issue where my spec files were not recognizing paths and displaying a red squiggle import warning in VS Code (and appearing under Problems), even though they functioned properly otherwise (testing worked, etc.). It seems to be related to a tsconfig problem rather than a linting issue, as the error message states:
Cannot find module '@feature/<reference path>.<file type>'.ts(2307)
Although it doesn't affect functionality much, it can be quite annoying (especially disrupting automatic imports).
Here's the content of tsconfig.json:
{
// Compiler options here
}
The paths mentioned in tsconfig.spec.json and tsconfig.app.json are aligned with the standard folder structure from angular-cli.
{
// Paths specified here
}
In angular.json file...
// Configuration details for test and lint
Versions used:
Angular CLI: 8.3.6
Node: 12.3.1
OS: win32 x64
Angular: 8.2.8
... list of packages and versions