I often see "exclude": ["**/*.test.ts", "**/*.test.tsx"] in project tsconfig file.
Sometimes there is a tsconfig.json without this but another tsconfig.build.json which override this file and add this exclusion.
My questions are:
Depends on your use case. Smaller builds are good, but at what cost? Does your module need to be tested by everyone, or is a single test on the build enough?
Also, if you have something like ts-jest in your devDependencies, your tests will be run as pure TypeScript, so you wouldn't need to compile them.
I agree with the first answer. Just wanted to comment (but don't have enough reputation yet to do it).
In case we want to exclude those from tsconfig.json and want to apply the quality standards to code anyway we can create another file, for instance, tsconfig.eslint.json and extend tsconfig there. Then pass an empty array to exclude object. Then link this file for eslint config to use.
Example of tsconfig.eslint.json:
{
"extends": "./tsconfig",
"exclude": []
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With