Skip to content
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

make the syntax error message more helpful for TS users #11807

Merged
merged 5 commits into from Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,8 @@

### Features

- `[jest-transform]` Improve the unexpected token error message. ([#11807](https://github.com/facebook/jest/pull/11807))

### Fixes

### Chore & Maintenance
Expand Down
3 changes: 3 additions & 0 deletions packages/jest-transform/src/enhanceUnexpectedTokenMessage.ts
Expand Up @@ -45,6 +45,9 @@ Here's what you can do:
${DOT}If you are trying to use ECMAScript Modules, see ${chalk.underline(
'https://jestjs.io/docs/ecmascript-modules',
)} for how to enable it.
${DOT}If you are trying to use TypeScript, see ${chalk.underline(
'https://jestjs.io/docs/getting-started#using-typescript',
)}
${DOT}To have some of your "node_modules" files transformed, you can specify a custom ${chalk.bold(
'"transformIgnorePatterns"',
)} in your config.
Expand Down