5

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...

1
  • the steps which you followed? Commented Dec 12, 2017 at 22:06

2 Answers 2

8

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/**"
}]
Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.