tsdjs / tsd

Check TypeScript type definitions
MIT License
2.38k stars 68 forks source link

Option to disable rules #140

Open olivier-martin-sf opened 2 years ago

olivier-martin-sf commented 2 years ago

Hi,

Thank you for putting this lib together and providing a way to test type declarations that aren't part of DefinitelyTyped easily. I am also aware that both take different approaches and have different constraints.

Question

I would like to know if adding the possibility to disable the rules would make sense? AFAIK such option isn't present yet?

Context

I ask that question as I working on a compiler that generates declaration files (not from tsc). Now, I need to add tests on the generated declaration files, in a unit test folder, so that I can ensure that the compiler generates the correct types and detect regressions over time.

That's my current pain point, those declaration files aren't part of a lib that intends to be published on any registry. They are tests fixtures for which I would like to write some tests (on types). As such, those files aren't part of the files property in the package.json file and trying to use tsd in that setup just fail returning me the error from the files-property rule.

I am aware that my use case is a bit a stretch from what tsd is designed to handle (testing types as a lib author) but if such a use case would make sense and is acceptable with what the lib intends to do I am willing to put some time or at least collaborate on this.