Open MikeMcC399 opened 6 months ago
@MikeMcC399 That's interesting. I don't recall why we decided to strip these rules. Looks like this was done 7 years ago, so it's just been there forever.
To (temporarily?) mitigate this issue, the example
https://github.com/cypress-io/eslint-plugin-cypress/blob/master/FLAT-CONFIG.md#cypress-recommended
is shown with the rule cypress/no-unnecessary-waiting
set to off
:
import pluginCypress from 'eslint-plugin-cypress/flat'
export default [
pluginCypress.configs.recommended,
{
rules: {
'cypress/no-unnecessary-waiting': 'off'
}
}
]
Current behavior
"Scaffold example specs" loaded into the
cypress/e2e/2-advanced-examples
directory by the Cypress E2E onboarding process fail linting using the recommended configuration as defined by the Cypress-provided cypress-io/eslint-plugin-cypress npm module.The following two files fail the rule
cypress/no-unnecessary-waiting
:/cypress/e2e/2-advanced-examples/viewport.cy.js
/cypress/e2e/2-advanced-examples/waiting.cy.js
Desired behavior
All "Scaffold example specs" loaded into the
cypress/e2e/2-advanced-examples
directory by the Cypress E2E onboarding process should pass linting using the recommended configuration as defined by the Cypress-provided cypress-io/eslint-plugin-cypress npm module.The two files which break the
cypress/no-unnecessary-waiting
rule are legitimately usingcy.wait()
and should not be called out for this in linting. This is "necessary waiting" not "unnecessary waiting".Test code to reproduce
Note the 15 linting failures concerning
cypress/no-unnecessary-waiting
.Cypress Version
First reported on version
13.7.0
Reproducible also on version13.15.0
Node version
v20.12.2
v20.17.0
Operating System
Ubuntu
22.04.4
LTSDebug Logs
Other
The original source of the examples is cypress-io/cypress-example-kitchensink.
cypress/no-unnecessary-waiting
/* eslint-disable cypress/no-unnecessary-waiting */
.yarn workspace @packages/example build
stripseslint
strings from the source in https://github.com/cypress-io/cypress/blob/develop/packages/example/bin/convert.js so the final example files used in Cypress scaffolding are exposed to the waiting rule.eslint Version
8.57.0
9.10.0
eslint-plugin-cypress Version
2.15.1
3.5.0