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
Next.js apps fail to lint with jest.config.ts #9982
Comments
I have found a temporary solution: adding an explicit |
…e `export default` (#10035) * fix(testing): jest.preset.ts => jest.preset.js * fix(testing): update to export default * fix(testing): migration for moving to export default * fix(testing): add eslint ignore comments for jest config properties fixes: #10021 * fix(testing): update tsconfig.spec.json for next apps with project parserOptions fixes: #9982 * fix(testing): prevent renaming root jest preset fixes: #9973 * fix(testing): update snapshots for export default * fix(testing): bump migration version to run * fix(testing): make sure default jest tests pass for various projects * fix(js): generate correct jest config for --compiler=swc --js
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Newer Nx projects that have run the
jest.config.js
->jest.config.ts
migration (or brand new workspaces) fail to lint Next.js applications due to a bug with how thejest.config.ts
isincluded
/excluded
in thetsconfig.*.json
files.Expected Behavior
A Next.js app should lint successfully just as it did prior to the conversion from
jest.config.js
->jest.config.ts
.Steps to Reproduce
setParserOptionsProject
flagnpx nx lint your-next-app
It appears the
jest.config.ts
isexcluded
intsconfig.json
, andincluded
in thetsconfig.spec.json
. However, the inclusion does not appear to be working properly (see error below).Failure Logs
Environment
Node : 14.17.6
OS : darwin x64
npm : 6.14.15
nx : 14.0.2
@nrwl/angular : Not Found
@nrwl/cypress : 14.0.2
@nrwl/detox : Not Found
@nrwl/devkit : 13.10.2
@nrwl/eslint-plugin-nx : 14.0.2
@nrwl/express : Not Found
@nrwl/jest : 14.0.2
@nrwl/js : 14.0.2
@nrwl/linter : 14.0.2
@nrwl/nest : Not Found
@nrwl/next : 14.0.2
@nrwl/node : Not Found
@nrwl/nx-cloud : 13.3.1
@nrwl/nx-plugin : Not Found
@nrwl/react : 14.0.2
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.0.2
@nrwl/web : 14.0.2
@nrwl/workspace : 14.0.2
typescript : 4.6.3
rxjs : 6.6.7
The text was updated successfully, but these errors were encountered: