yrming / vscode-type-challenges

Take Type Challenges in VS Code
https://marketplace.visualstudio.com/items?itemName=YRM.type-challenges
MIT License
44 stars 12 forks source link

fix: tsconfig.default.json is not work in vscode #16

Closed Drincann closed 1 year ago

Drincann commented 1 year ago
yrming commented 1 year ago
  • rename tsconfig.default.json: vscode recognizes tsconfig.json but not tsconfig.default.json.

I'm a bit confused about this. For me, the reason to use tsconfig.default.json instead of tsconfig.json is that after the execution of the vsce package command, I hope there will be a .json file containing ts configuration in the package file, which will be used by the tsc command.

Drincann commented 1 year ago

I'm sorry I didn't explain this clearly. I mean, when the name of the ts configuration file is not "tsconfig.json", vscode cannot recognize it as the ts configuration of the current answer file.

For the question simple-vue , after using just the content of the ts configuration I just modified in this pr, the correct answer can pass the compiler's check using tsc cli, but the error will still be displayed in the vscode editor, like this in the cases context is still inferred as any, because the correct configuration we maintained cannot be recognized by vscode because of the naming.

The user sees that there is an error in the vscode, But still passed the type check, or the situation can be reversed. This is a bit wired.

yrming commented 1 year ago

@Drincann I see, thank you very much for the pr, I'll merge later today and fix this.