Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of looking into #887 I ran into a ton of difficulty getting
ts-jest
to work with ESM, with one of the main issues being related to importing./utils.js
style files.This seems to be an issue with the combination of TypeScript + Jest when using ESM, and the
ts-jest
preset hasn't "fixed" this yet (by doing something like themoduleNameMapper
approach mentioned in comments like this. Has there not been any PR from someone?In any case, it's a bit frustrating that there wasn't a mention of this in the troubleshooting docs as the issue above was pretty well trafficked and commented on, and while there was a PR, it was closed and there was no follow up. What's worse is that this issue has been known for at least 4 years. There really should have been a troubleshooting section added here even without a community contributed PR, and so I don't have faith that either an additon to the preset or a mention in the troubleshooting docs will happen anytime soon, at least before I want to get Stylelint 16 in main.
While checking types in the test code is useful, it's not that important since the actual code is type checked separately (both with the linter and the compilation steps), and since
@swc/jest
is simpler and hopefully doesn't have the above frustration factor, I've decided to migrate fromts-jest
to@swc/jest
.If at some point type checking the tests becomes important the lint:types task can be updated to check test code too.