When I input a custom command in commands.js
, WebStorm's linter flags both Cypress
and cy
as undefined without providing any IntelliSense support. Oddly enough, these are properly defined in all integration
files.
In commands.js
Cypress.Commands.add('command', () => {
cy.get('div');
});
// ESLint: 'Cypress' is not defined.(no-undef)
// ESLint: 'cy' is not defined.(no-undef)
In index.js
import './commands.js'
This issue doesn't occur in VSCode, where both Cypress
and cy
are recognized as any
.
Even with this error, the tests run smoothly without any problems.
Is there a way to make the linter acknowledge Cypress within its own files?