Skip to content

chore: address eslint warnings in CLI#33430

Open
jennifer-shehane wants to merge 2 commits intodevelopfrom
chores-cli-eslint-warnings
Open

chore: address eslint warnings in CLI#33430
jennifer-shehane wants to merge 2 commits intodevelopfrom
chores-cli-eslint-warnings

Conversation

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Mar 3, 2026

  • Closes

Additional details

Addresses warnings in CLI when running yarn lint

/root/cypress/cli/lib/VerboseRenderer.ts
  10:3  warning  Unused eslint-disable directive (no problems were reported from 'no-console')
  43:9  warning  Unused eslint-disable directive (no problems were reported from 'no-console')

/root/cypress/cli/lib/exec/info.ts
  1:1  warning  Unused eslint-disable directive (no problems were reported from 'no-console')

/root/cypress/cli/lib/logger.ts
  11:39  warning  Unused eslint-disable directive (no problems were reported from 'no-console')
  18:42  warning  Unused eslint-disable directive (no problems were reported from 'no-console')
  25:28  warning  Unused eslint-disable directive (no problems were reported from 'no-console')
  30:28  warning  Unused eslint-disable directive (no problems were reported from 'no-console')

/root/cypress/cli/scripts/sync-typedefs.ts
  21:1   warning  Synchronous fs calls should not be used in Cypress. Use an async API instead  no-restricted-syntax
  26:3   warning  Synchronous fs calls should not be used in Cypress. Use an async API instead  no-restricted-syntax
  76:1   warning  Synchronous fs calls should not be used in Cypress. Use an async API instead  no-restricted-syntax
  91:23  warning  Synchronous fs calls should not be used in Cypress. Use an async API instead  no-restricted-syntax
  97:3   warning  Synchronous fs calls should not be used in Cypress. Use an async API instead  no-restricted-syntax

/root/cypress/cli/test/lib/exec/info.spec.ts
  71:5  warning  Unused eslint-disable directive (no problems were reported from 'no-console')

/root/cypress/cli/test/lib/tasks/cache.spec.ts
  54:5  warning  Unused eslint-disable directive (no problems were reported from 'no-console')

/root/cypress/cli/test/lib/tasks/download.spec.ts
  100:5   warning  Unused eslint-disable directive (no problems were reported from 'no-console')
  300:26  warning  Synchronous fs calls should not be used in Cypress. Use an async API instead   no-restricted-syntax

/root/cypress/cli/test/lib/tasks/state.spec.ts
  124:14  warning  Use the spread operator instead of '.apply()'  prefer-spread

/root/cypress/cli/test/lib/tasks/unzip.spec.ts
  67:5  warning  Unused eslint-disable directive (no problems were reported from 'no-console')

/root/cypress/cli/types/cy-minimatch.d.ts
  95:21  warning  Missing space before function parentheses  @stylistic/space-before-function-paren

/root/cypress/cli/types/cypress-eventemitter.d.ts
   2:29  warning  Strings must use singlequote  @stylistic/quotes
  33:33  warning  Strings must use singlequote  @stylistic/quotes

/root/cypress/cli/types/cypress-expect.d.ts
  2:1  warning  Unexpected var, use let or const instead  no-var
  3:1  warning  Unexpected var, use let or const instead  no-var

/root/cypress/cli/types/cypress-global-vars.d.ts
  10:1  warning  Unexpected var, use let or const instead  no-var
  22:1  warning  Unexpected var, use let or const instead  no-var

/root/cypress/cli/types/net-stubbing.d.ts
  494:5  warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-unused-vars')

/root/cypress/cli/types/tests/actions.ts
  74:43  warning  There should be no space before ','  @stylistic/comma-spacing
  79:49  warning  There should be no space before ','  @stylistic/comma-spacing
  84:42  warning  There should be no space before ','  @stylistic/comma-spacing
  90:22  warning  A space is required after '{'        @stylistic/object-curly-spacing
  90:44  warning  A space is required before '}'       @stylistic/object-curly-spacing
  91:22  warning  A space is required after '{'        @stylistic/object-curly-spacing
  91:47  warning  A space is required before '}'       @stylistic/object-curly-spacing
  92:30  warning  A space is required after '{'        @stylistic/object-curly-spacing
  92:55  warning  A space is required before '}'       @stylistic/object-curly-spacing
  93:37  warning  A space is required after '{'        @stylistic/object-curly-spacing
  93:63  warning  A space is required before '}'       @stylistic/object-curly-spacing
  94:22  warning  A space is required after '{'        @stylistic/object-curly-spacing
  94:44  warning  A space is required before '}'       @stylistic/object-curly-spacing
  95:22  warning  A space is required after '{'        @stylistic/object-curly-spacing
  95:43  warning  A space is required before '}'       @stylistic/object-curly-spacing

/root/cypress/cli/types/tests/chainer-examples.ts
   13:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
   50:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
   51:19  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
   57:3   warning  Expected blank line before this statement  padding-line-between-statements
   57:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
   64:1   warning  Expected blank line before this statement  padding-line-between-statements
   66:3   warning  Expected blank line before this statement  padding-line-between-statements
   66:23  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
   67:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
   73:3   warning  Expected blank line before this statement  padding-line-between-statements
   73:23  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
   95:14  warning  A space is required after '{'              @stylistic/object-curly-spacing
   95:21  warning  A space is required before '}'             @stylistic/object-curly-spacing
  155:1   warning  Expected blank line before this statement  padding-line-between-statements
  157:3   warning  Expected blank line before this statement  padding-line-between-statements
  157:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  158:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  162:3   warning  Expected blank line before this statement  padding-line-between-statements
  168:1   warning  Expected blank line before this statement  padding-line-between-statements
  170:9   warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  178:1   warning  Expected blank line before this statement  padding-line-between-statements
  179:17  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  186:17  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  239:1   warning  Expected blank line before this statement  padding-line-between-statements
  241:3   warning  Expected blank line before this statement  padding-line-between-statements
  241:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  242:19  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  248:3   warning  Expected blank line before this statement  padding-line-between-statements
  248:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  255:1   warning  Expected blank line before this statement  padding-line-between-statements
  257:3   warning  Expected blank line before this statement  padding-line-between-statements
  257:23  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  258:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  264:3   warning  Expected blank line before this statement  padding-line-between-statements
  264:23  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  268:9   warning  A space is required after '{'              @stylistic/object-curly-spacing
  274:9   warning  A space is required after '{'              @stylistic/object-curly-spacing
  274:14  warning  A space is required before '}'             @stylistic/object-curly-spacing
  274:31  warning  A space is required after '{'              @stylistic/object-curly-spacing
  274:36  warning  A space is required before '}'             @stylistic/object-curly-spacing
  274:56  warning  A space is required after '{'              @stylistic/object-curly-spacing
  274:61  warning  A space is required before '}'             @stylistic/object-curly-spacing
  282:14  warning  A space is required after '{'              @stylistic/object-curly-spacing
  282:21  warning  A space is required before '}'             @stylistic/object-curly-spacing
  307:1   warning  Expected blank line before this statement  padding-line-between-statements
  318:1   warning  Expected blank line before this statement  padding-line-between-statements
  320:3   warning  Expected blank line before this statement  padding-line-between-statements
  320:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  321:18  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  328:1   warning  Expected blank line before this statement  padding-line-between-statements
  330:9   warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  338:1   warning  Expected blank line before this statement  padding-line-between-statements
  339:17  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  346:17  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  450:36  warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  454:5   warning  Expected blank line before this statement  padding-line-between-statements
  457:21  warning  Missing trailing comma                     @stylistic/comma-dangle
  466:20  warning  Missing trailing comma                     @stylistic/comma-dangle
  468:1   warning  Expected blank line before this statement  padding-line-between-statements
  470:20  warning  Missing trailing comma                     @stylistic/comma-dangle
  477:1   warning  Expected blank line before this statement  padding-line-between-statements

/root/cypress/cli/types/tests/cypress-npm-api-test.ts
    8:28  warning  Missing trailing comma                               @stylistic/comma-dangle
   10:1   warning  Expected blank line before this statement            padding-line-between-statements
   10:22  warning  Expected parentheses around arrow function argument  @stylistic/arrow-parens
   13:1   warning  Expected blank line before this statement            padding-line-between-statements
   13:20  warning  Expected parentheses around arrow function argument  @stylistic/arrow-parens
   22:1   warning  Expected blank line before this statement            padding-line-between-statements
   26:15  warning  Strings must use singlequote                         @stylistic/quotes
   26:23  warning  Missing trailing comma                               @stylistic/comma-dangle
   35:17  warning  Missing trailing comma                               @stylistic/comma-dangle
   38:1   warning  Expected blank line before this statement            padding-line-between-statements
   45:20  warning  Expected parentheses around arrow function argument  @stylistic/arrow-parens
   50:30  warning  Missing trailing comma                               @stylistic/comma-dangle
   59:23  warning  Missing trailing comma                               @stylistic/comma-dangle
   68:25  warning  Missing trailing comma                               @stylistic/comma-dangle
   76:42  warning  Missing trailing comma                               @stylistic/comma-dangle
   85:6   warning  Missing trailing comma                               @stylistic/comma-dangle
   86:4   warning  Missing trailing comma                               @stylistic/comma-dangle
   94:6   warning  Missing trailing comma                               @stylistic/comma-dangle
   95:4   warning  Missing trailing comma                               @stylistic/comma-dangle
  103:6   warning  Missing trailing comma                               @stylistic/comma-dangle
  104:4   warning  Missing trailing comma                               @stylistic/comma-dangle
  112:6   warning  Missing trailing comma                               @stylistic/comma-dangle
  113:4   warning  Missing trailing comma                               @stylistic/comma-dangle
  121:6   warning  Missing trailing comma                               @stylistic/comma-dangle
  122:4   warning  Missing trailing comma                               @stylistic/comma-dangle

/root/cypress/cli/types/tests/cypress-tests.ts
  956:6   warning  Unexpected exclusive mocha test  mocha/no-exclusive-tests
  960:11  warning  Unexpected exclusive mocha test  mocha/no-exclusive-tests
  981:12  warning  Unexpected exclusive mocha test  mocha/no-exclusive-tests

/root/cypress/cli/types/tests/kitchen-sink.ts
    7:21  warning  Expected parentheses around arrow function argument  @stylistic/arrow-parens
    9:3   warning  Expected blank line before this statement            padding-line-between-statements
   10:9   warning  Expected parentheses around arrow function argument  @stylistic/arrow-parens
   17:1   warning  Expected blank line before this statement            padding-line-between-statements
   24:23  warning  Missing trailing comma                               @stylistic/comma-dangle
   25:4   warning  Missing trailing comma                               @stylistic/comma-dangle
   46:1   warning  Expected blank line before this statement            padding-line-between-statements
   69:8   warning  Strings must use singlequote                         @stylistic/quotes
   70:11  warning  Strings must use singlequote                         @stylistic/quotes
   71:11  warning  Missing trailing comma                               @stylistic/comma-dangle
   82:8   warning  Strings must use singlequote                         @stylistic/quotes
   84:23  warning  Missing trailing comma                               @stylistic/comma-dangle
   85:4   warning  Missing trailing comma                               @stylistic/comma-dangle
  107:11  warning  Missing trailing comma                               @stylistic/comma-dangle
  116:8   warning  Strings must use singlequote                         @stylistic/quotes
  117:11  warning  Strings must use singlequote                         @stylistic/quotes
  118:11  warning  Missing trailing comma                               @stylistic/comma-dangle
  120:1   warning  Expected blank line before this statement            padding-line-between-statements
  124:8   warning  Strings must use singlequote                         @stylistic/quotes
  125:11  warning  Strings must use singlequote                         @stylistic/quotes
  126:11  warning  Missing trailing comma                               @stylistic/comma-dangle
  128:1   warning  Expected blank line before this statement            padding-line-between-statements
  131:17  warning  Missing trailing comma                               @stylistic/comma-dangle
  133:1   warning  Expected blank line before this statement            padding-line-between-statements
  138:11  warning  Missing trailing comma                               @stylistic/comma-dangle
  139:4   warning  Missing trailing comma                               @stylistic/comma-dangle
  144:18  warning  Missing trailing comma                               @stylistic/comma-dangle
  145:4   warning  Missing trailing comma                               @stylistic/comma-dangle
  167:18  warning  Expected parentheses around arrow function argument  @stylistic/arrow-parens
  175:1   warning  Expected blank line before this statement            padding-line-between-statements
  175:10  warning  Strings must use singlequote                         @stylistic/quotes

/root/cypress/cli/types/tests/net-stubbing-tests.ts
   11:16  warning  Missing trailing comma                     @stylistic/comma-dangle
   26:7   warning  Expected blank line before this statement  padding-line-between-statements
   31:7   warning  Expected blank line before this statement  padding-line-between-statements
   38:7   warning  Expected blank line before this statement  padding-line-between-statements
   43:7   warning  Expected blank line before this statement  padding-line-between-statements
   50:7   warning  Expected blank line before this statement  padding-line-between-statements
   55:7   warning  Expected blank line before this statement  padding-line-between-statements
   60:7   warning  Expected blank line before this statement  padding-line-between-statements
   65:7   warning  Expected blank line before this statement  padding-line-between-statements
   72:7   warning  Expected blank line before this statement  padding-line-between-statements
   77:7   warning  Expected blank line before this statement  padding-line-between-statements
   84:7   warning  Expected blank line before this statement  padding-line-between-statements
   89:7   warning  Expected blank line before this statement  padding-line-between-statements
  110:7   warning  Expected blank line before this statement  padding-line-between-statements
  115:7   warning  Expected blank line before this statement  padding-line-between-statements
  263:7   warning  Expected blank line before this statement  padding-line-between-statements
  268:7   warning  Expected blank line before this statement  padding-line-between-statements

/root/cypress/cli/types/tests/plugins-config.ts
   25:5   warning  Expected blank line before this statement  padding-line-between-statements
   63:8   warning  Missing space before function parentheses  @stylistic/space-before-function-paren
   65:6   warning  Missing trailing comma                     @stylistic/comma-dangle
   70:39  warning  Missing trailing comma                     @stylistic/comma-dangle
   71:6   warning  Missing trailing comma                     @stylistic/comma-dangle
  104:8   warning  Missing space before function parentheses  @stylistic/space-before-function-paren
  106:6   warning  Missing trailing comma                     @stylistic/comma-dangle
  111:39  warning  Missing trailing comma                     @stylistic/comma-dangle
  112:6   warning  Missing trailing comma                     @stylistic/comma-dangle
  119:19  warning  Missing trailing comma                     @stylistic/comma-dangle

Note

Medium Risk
Mostly lint/style churn, but it changes distributed .d.ts global declarations (e.g. declare let and Window augmentation), which could surface type conflicts in downstream TypeScript projects.

Overview
Resolves CLI eslint warnings by removing unused no-console disables, fixing minor style issues, and refactoring scripts/sync-typedefs.ts to use async fs-extra APIs with explicit error handling.

Updates Cypress TypeScript declarations by switching ambient globals (Cypress, cy, expect, assert) from var to let and adding a new Window augmentation (cypress-global-augmentation.d.ts, referenced from types/index.d.ts) so window.Cypress/window.cy are typed; related type tests and a few unit tests were updated to satisfy new lint rules (async file hashing/stat, prefer-spread, formatting).

Written by Cursor Bugbot for commit 050ddd5. This will update automatically on new commits. Configure here.

Steps to test

How has the user experience changed?

PR Tasks

@jennifer-shehane jennifer-shehane self-assigned this Mar 3, 2026
@cypress
Copy link

cypress bot commented Mar 3, 2026

cypress    Run #69288

Run Properties:  status check failed Failed #69288  •  git commit 050ddd5862: global augmentation
Project cypress
Branch Review chores-cli-eslint-warnings
Run status status check failed Failed #69288
Run duration 26m 35s
Commit git commit 050ddd5862: global augmentation
Committer Jennifer Shehane
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 13
Tests that did not run due to a developer annotating a test with .skip  Pending 1112
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 27135
View all changes introduced in this branch ↗︎
UI Coverage  61.04%
  Untested elements 28  
  Tested elements 47  
Accessibility  99.02%
  Failed rules  0 critical   3 serious   1 moderate   0 minor
  Failed elements 19  

Tests for review

Failed  cypress/e2e/studio/studio-ui.cy.ts • 1 failed test • app-e2e

View Output

Test Artifacts
Cypress Studio - UI and Panel Management > studio AI is marked as coming soon Test Replay Screenshots
Flakiness  commands/files.cy.js • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > throws when there is an error reading the file Test Replay
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
... > stops waiting when an xhr request is canceled
    </td>
  </tr></table>
Flakiness  commands/files.cy.js • 2 flaky tests • 5x-driver-firefox

View Output

Test Artifacts
src/cy/commands/files > #readFile > retries assertions until they pass
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="https://cloud.cypress.io/projects/ypt4pf/runs/69288/overview/2a882396-9c69-40b7-92e5-e68d3a9a45f2?reviewViewBy=FLAKY&utm_source=github&utm_medium=failed&utm_campaign=view%20test">
        ... > has implicit existence assertion and throws a specific error when file does not exist
      </a>
    </td>
    <td>
      
    </td>
  </tr></table>

The first 5 flaky specs are shown, see all 11 specs in Cypress Cloud.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

```
*/
declare var Cypress: Cypress.Cypress & CyEventEmitter
declare let Cypress: Cypress.Cypress & CyEventEmitter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

declare var to let breaks globalThis type access

High Severity

Changing declare var to declare let for cy, Cypress, expect, and assert in ambient declarations removes these globals from globalThis typing. In TypeScript, only declare var creates properties accessible on globalThis; declare let does not. This breaks code using globalThis.Cypress as a type reference — notably npm/react/src/createMount.ts and npm/react/src/types.ts which use globalThis.Cypress.Chainable<MountReturn> as return types. The test workaround using a type cast in cypress-tests.ts masks this regression rather than preserving the original behavior.

Additional Locations (1)

Fix in Cursor Fix in Web

Triggered by project rule: Overview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant