Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Add explicit include compiler property to tsconfig. Closes #159 #166

Closed
wants to merge 1 commit into from

Conversation

peterblazejewicz
Copy link

The explicit property declaration is based on comment from:
#159 https://git.io/v5hxz
and TS handbook:
https://git.io/v5hxK

I'v recreated issue locally. I've hit the same problem myself when using NG 2 cli some time ago and 3rd party tools that have been adding bower/npm packages (with .ts) into public dir. The use-case of the OP seems reasonable for me.

Thanks!

The explicit property declaration is based on comment from:
wmonk#159 https://git.io/v5hxz
and TS handbook:
https://git.io/v5hxK

Thanks!
@ianschmitz
Copy link
Contributor

ianschmitz commented Sep 21, 2017

Have we considered overwriting the current exclude with what was commented in #159?

  "include": [
    "src/**/*"
  ],
  "exclude": [
    "src/setupTests.ts",
    "src/**/*.{test,spec}.{ts,tsx}",
    "src/**/__tests__/*"
  ]

My thought is that the previous exclude entries were necessary since we didn't have the explicit include. But now that we have that we should be able to just exclude what is not necessary from the src directory (which should be just those 3 entries above i believe).

Thanks!

@ssylvia
Copy link

ssylvia commented Jun 21, 2018

@ianschmitz @wmonk Is there a reason to exclude test files and setupTest.ts files in the main tsconfig.json? VSCode TSLint plugin uses that files by default for linting durning development. I get Type errors is VSCode during development in my test files if I run if I have those files excluded.

For example, I am adding this lib: https://github.com/gnapse/jest-dom, and Importing it in the src/setupTests.ts file: https://github.com/gnapse/jest-dom#usage.

Would it be better to only add those excluded files to tslint.prod.json?

Or should we have a tslint.dev.json that is used by webpack so tslint.json can be use by VSCode plugins?

Also, I think you need to add images.d.ts to the include array.

@ianschmitz
Copy link
Contributor

Yeah I think you're correct @ssylvia.

The downside to my approach listed above is that type errors in test files aren't caught during build or test. I have since changed to including all src files to catch those cases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants