Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File 'src/app/app.component.spec.ts' is not part of Typescript project while upgrading to Angular 5

Tags:

angular5

File 'src/app/app.component.spec.ts' is not part of Typescript project 'src/tsconfig.app.json' while upgrading to Angular 5

We have followed all the instructions for converting our project from angular 4 but are pulling out our hair over this one - anyone have any ideas?

We are getting this error from tslint...

like image 794
John LaCroix Avatar asked Dec 12 '17 17:12

John LaCroix


2 Answers

Change the "lint" section of .angular-cli.json by replacing all of the "files" entries with "exclude" entries...

"lint": [
{
  "project": "src/tsconfig.app.json",
  "files": "src/**/*.ts"
},
{
  "project": "src/tsconfig.spec.json",
  "files": "src/**/*.spec.ts"
},
{
  "project": "e2e/tsconfig.e2e.json",
  "files": "e2e/**/*.ts"
}]

becomes

"lint": [
{
  "project": "src/tsconfig.app.json",
  "exclude": "**/node_modules/**"
},
{
  "project": "src/tsconfig.spec.json",
  "exclude": "**/node_modules/**"
},
{
  "project": "e2e/tsconfig.e2e.json",
  "exclude": "**/node_modules/**"
}]
like image 199
Miller Avatar answered Nov 11 '22 22:11

Miller


Turns out the files specified in our .angular-cli.json for our lint configuration, but we should have been just relying on the files specified in our tsconfig.json files. We removed the files from angular-cli.json and all is well.

like image 2
John LaCroix Avatar answered Nov 11 '22 22:11

John LaCroix