Closed ronparkdev closed 10 months ago
To reproduce this issue,
// @ts-strict
addedconst params = await object({ id: string().required(), }).validate({})
, the type of params should be { id: string }
, but it is caught as { id?: string }
because the library is not strict.The solution is to do the above.
I'm glad you're enjoying the library! Your idea is interesting, but unfortunately, as you've rightly pointed out, there are some limitations to the approach.
The TypeScript language service plugins operate with the files that are currently open in your editor, and don't have access to all the files in your project, especially those inside node_modules. It would be very resource-intensive to proccess every file in there, so it's unfortunately not possible right now.
Thank you for the idea though!
Hi,
I'm using your plugin well to increase strict code in a non-strict project. But I'm facing one problem
// @ts-strict
added using typescript-strict-plugin -> type catching// @ts-strict
-> library is not strict.Of course, this is not the role of typescript-strict-plugin, so it's normal, But we can't just add
// @ts-strict
to a library in node_modules, can we?So I thought about adding a
config.forceInclude
similar toconfig.exclude
.If it's included in
config.forceInclude
, it will be strict even if it doesn't have// @ts-strict
.Anyway, thanks for the library, I'm enjoying using it!