3

Update the Angular version in My project after when npm start give warning

WARNING in E:\bansi\project\BTT\BTT_new - angular 9.0.1\BTTReport_AspnetZero_New\BTTCorpAngular-master\src\app\btt-report\monthly-report\monthly-report.component.spec.ts is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in your tsconfig. and when build my project get lots of error.I'm tired to change dependancy add and remove.

I'm added the tsconfig.app.json file

{
  "extends": "./tsconfig.json",
    "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": []
  },
  "files": [
  "src/main.ts",
  "src/polyfills.ts"
],
 "include": [
 "src/**/*.ts"
],
   "exclude": [
   "src/test.ts",
   "src/**/*.spec.ts"
  ]
}

Ivy Workspace: <error>

Bansi29
  • 1,053
  • 6
  • 24
  • The warning is due to lint config. below discussion may help. https://stackoverflow.com/questions/47778839/file-src-app-app-component-spec-ts-is-not-part-of-typescript-project-while-upg . – Laminoo Lawrance Feb 25 '20 at 10:23
  • @LaminooLawrance It already added it not working. – Bansi29 Feb 26 '20 at 09:24
  • @Bansi29 can u remove src? and try again? == "**/*.spec.ts", like this – Energy Mar 30 '20 at 06:58
  • Hi,@Energy Thanks for the response but , it getting warnings as per `report\monthly-report.component.spec.ts is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in your tsconfig.` – Bansi29 Mar 30 '20 at 07:49

1 Answers1

0

As mentionned here : How to get rid of the warning .ts file is part of the TypeScript compilation but it's unused

Removing "src/**/*.ts" from the include array does the trick.

Or you can just add the unused files in the exclude array on tsconfig.app.json

Serigne
  • 21
  • 1
  • 5