-
-
Notifications
You must be signed in to change notification settings - Fork 22
Supprt .ts and .cts config files via Node type-stripping #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
What's the reason for doing this with rules_jest specifically? I'd like to have some discussions about this in rules_js before we start enabling it for random files such as jest config... |
|
@jbedard forgive me if I'm lacking context, but I feel like rules_jest shouldn't limit which config file types can be passed to Jest. Should rules_jest not just plumb through whatever file is provided, and if Jest or Node can't parse it, then just let them error? Compiling the config file with ts_project beforehand will work, but it's extra boilerplate that doesn't really provide any benefit if I'm already type checking the config file in another target. If Jest and the latest version of Node both support TypeScript config files without any additional configuration, why should rules_jest disallow TypeScript?
Just so we're on the same page, this PR doesn't enable/enforce the usage of type stripping in rules_jest, it just removes the restriction on |


Changes are visible to end-users: yes
TypeScript Jest configuration files can be parsed using Node's type stripping functionality.
.mtshas been omitted as it is not supported by Jest.Closes #229
Test plan
If on Node version >= 22.6.0, < 23.6.0, run a
jest_testtarget with a.tsor.ctsconfig file with:Node versions >= 23.6.0 should just work, as type stripping is enabled by default.
Node versions < 22.6.0 do not have type stripping support.