ixartz/Next-js-Boilerplate

ESLint parsing error due to parserOptions config. Related to Cypress/Jest?

CarpeDN opened this issue · 7 comments

Hi, great boilerplate by the way. I am seeing this error when I run npm run lint. could it be related to the type check issues with Cypress and Jest?

./cypress/support/e2e.ts
Error: Parsing error: ESLint was configured to run on `<tsconfigRootDir>/cypress/support/e2e.ts` using `parserOptions.project`: <tsconfigRootDir>/../../../../../../users/carpedn/gitlab/boilerplates/next-js-boilerplate/tsconfig.json
However, that TSConfig does not include this file. Either:
- Change ESLint's list of included files to not include this file
- Change that TSConfig to include this file
- Create a new TSConfig that includes this file and include it in your parserOptions.project
See the TypeScript ESLint docs for more info: https://typescript-eslint.io/docs/linting/troubleshooting##i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file

Hi @CarpeDN,

Thank you for sharing your issue. I just tried on my local machine and I don't have the same issue as you.

I have only a warning not error. And, this is normal because, I just update to TypeScript 4.9.

npm run lint

> next-js-boilerplate@3.0.0 lint
> next lint

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.9.0

YOUR TYPESCRIPT VERSION: 4.9.3

Please only submit bug reports when using the officially supported version.

=============
✔ No ESLint warnings or errors

Did you made some change?

Hi @ixartz ,

Hmm, very odd. No I haven't, it's a fresh git clone of the project. I just tried removing /node_modules and reinstalling and still encountering the same issue

@CarpeDN Did you use npm? It should work with other package manager but with npm, there is the package-lock file. So, you should have exactly the same dependencies as me.

I deleted the project and reinstalled with npm. works now, not sure what i was doing wrong. Please disregard! closing this issue now

@CarpeDN Thank you for updating the issue, happy it's now solved.

Ran into this issue—deleted the .next folder and built again fresh. Back on track!

ixartz commented

@johnnyrwest Thank you for sharing, it can helpful for people who run the same issue.