Closed tomers closed 4 years ago
https://github.com/cypress-io/eslint-plugin-cypress should be used and a .eslintrc.js
file should be added automatically inside test/cypress
folder upon initialization.
Via configuration cascading, it would enable Cypress linting rules, plugin and globals only inside cypress folder, extending root-level rules for all other
@nothingismagick this should be pretty easy
Suggested ESLint configuration:
module.exports = {
extends: [
// Add Cypress-specific lint rules, globals and Cypress plugin
// See https://github.com/cypress-io/eslint-plugin-cypress#rules
'plugin:cypress/recommended',
],
};
EDIT: Cypress team updated its recommended config to include globals, I updated the configuration to use
Software version
OS: macOS High Sierra 10.13.6 Node: v12.3.1 NPM: 6.9.0 Yarn: 1.16.0
Any other software related to your bug:
What did you get as the error?
When writing tests after installing the
quasar-app-extension-testing-e2e-cypress
package, I see lining errors:describe is not defined
in my IDE (IntelliJ).I also get the following errors:
it
: "Element is not exported", and "Missing import statement"cy
: "ESLint: 'cy' is not defined"What were you expecting?
I would expect that the extension installation script would configure eslint properly, so that it will support the Cypress.io, Mocha and Chai directives.
What steps did you take, to get the error?
No steps needed - just write tests and see it.
How did you mitigate this issue?
I manually set the following in
.eslintrc.js
:This helped resolve the
describe is not defined
error, but still I get warning for the describe and it globals: