Skip to content

Lint fails on freshly scaffolded projects with ESLint and Cypress #195

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

Closed
jbenner-radham opened this issue Nov 12, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@jbenner-radham
Copy link

jbenner-radham commented Nov 12, 2022

Running npm run lint after scaffolding out a new project which has ESLint and Cypress via npm init vue@latest returns the following error:

cypress-config-lint-test npm run lint

> [email protected] lint
> eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore


/home/james/Development/cypress-config-lint-test/cypress.config.js
  1:26  error  'require' is not defined  no-undef
  3:1   error  'module' is not defined   no-undef

✖ 2 problems (2 errors, 0 warnings)

This can be fixed by adding /* eslint-env node */ to the top of the cypress.config.js file.

P.S. Thanks for the awesome open source software and all the work you put into it! 😃

@haoqunjiang haoqunjiang added the bug Something isn't working label Dec 19, 2022
@tobius
Copy link

tobius commented Feb 8, 2023

I had the same experience, but was using playwright. I added /* eslint-env node */ to playwright.config.js and e2e/vue.spec.js to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants