`cypress.config.ts` triggers ESLint errors
See original GitHub issueCurrent behavior
When configuring Cypress with cypress.config.ts
(TypeScript file), and using ESLint with parser: '@typescript-eslint/parser'
the following error is triggered:
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: cypress.config.ts.
The file must be included in at least one of the projects provided.eslint
Basically, because a TypeScript file is not included in my tsconfig.json
this error is triggered and neither /* eslint-disable */
or /* eslint-disable-next-line */
will fix the error.
The only way to fix it is to add cypress.config.ts
in my .eslintignore
file which disabled linting on the config file (not ideal).
I also cannot include
cypress.config.ts
in my tsconfig.json
because it would compile the file.
Desired behavior
There shouldn’t be any ESLint issue related to the cypress.config.ts
Maybe an idea would be to move the config file under the cypress
directory and make sure it’s included in the Cypress tsconfig.json
?
Test code to reproduce
An example should be available as soon as I push my changes here: https://github.com/Avansai/next-multilingual
Cypress Version
latest
Other
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
I actually found a decent workaround, I simply added
cypress.config.ts
in thecypress/tsconfig.json
file like that:This might be worth adding somewhere in the documentation?
@arimgibson thanks for sharing. I didn’t use that but instead added this in my parent
tsconfig.json
: