Closed John0King closed 2 years ago
I can't reproduce this locally. Here's my layout:
tsconfig.json
src/a.ts
src/b.ts <-- contains an error
tsconfig.json:
{
"compilerOptions": {
},
"include": [
"./src/**/*"
],
"exclude": [
"./src/b.ts"
]
}
This compiles without error; changing "./src/b.ts"
to "./src/x.ts"
causes the error to be found as expected.
Can you provide more detail on how to reproduce the problem? Thanks!
@RyanCavanaugh I'm try port signalr to wechat miniprogram , this is my project https://github.com/John0King/WeChatApp.SignalR , and I know there will be many error in source file and becase I remove dom
lib, but the there are two main probelm for me ,
"miniprogram-api-typings": "^2.8.3"
with yarn , but It won't show it's declerationI had a similar issue. In my case one of the files in the source was being auto-generated using ts-pegjs and didn't comply with the strict
typescript. The rest of my files did, so I wanted the compiler to hush up about the errors in that file. I couldn't change the file, so I tried putting the file in the exclude
list. But the errors still occurred.
As it turns out, I was misunderstanding the intended behavior of the exclude
option and thought that it would silence errors from files that I wanted it ignore. In the tsconfig docs it notes regarding the exclude
option that
Any files that are referenced by files included via the "files" or "include" properties are also included. Similarly, if a file B.ts is referenced by another file A.ts, then B.ts cannot be excluded unless the referencing file A.ts is also specified in the "exclude" list.
Since my generated file was still being imported somewhere in my source, typescript was disregarding my attempt to exclude it. Perhaps your files are still being imported somewhere too? I hope this help.
Hi @codechaotic , thanks for your input, I have the exact same issue: what workaround do you use to ignore the error in the generated file ?
TypeScript Version: 3.6.2
Code
Expected behavior:
tsc will ignore those files .
Actual behavior: