Skip to content

Conversation

MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented Sep 1, 2025

Situation

standard@13.1.0 released on Jul 21, 2019 is configured in this repo. The latest version is standard@17.1.2, released one year ago in Sep 2024, and which uses outdated dependencies, such as eslint@8.57.1 with end-of-life on Oct 5, 2024.

prettier-standard@8.0.1 released on Apr 5, 2018 is configured in this repo. The latest version is prettier-standard@16.3.0, released 5 years ago in Apr 2020, and which uses outdated dependencies, such as eslint@6.8.0 with end-of-life on Nov 8, 2020, and multiple unfixable vulnerabilities:

15 vulnerabilities (4 low, 3 moderate, 6 high, 2 critical)

Assessment

The above two dependencies need to be considered together, since they are interdependent. They also each depend on different versions of ESlint.

Change

Remove standard and prettier-standard, and replace with supported npm packages:

For scripts:

  • migrate script lint from standard to eslint
  • remove scripts prelint and pretty

Apply npx eslint --fix, after setting rules as below, to autofix linting.

Rules

Apply a rule strategy based on each linter's recommended configuration:

In case of linting errors, add rules aligned to linting choices in https://github.com/cypress-io/cypress

Rule Setting Cypress reference
mocha/max-top-level-suites off packages/eslint-config
mocha/no-mocha-arrows off packages/eslint-config
mocha/no-setup-in-describe off packages/eslint-config
@stylistic/arrow-parens ['error', 'always'] npm/eslint-plugin-dev
@stylistic/comma-dangle ['error', 'always-multiline'] packages/eslint-config
@stylistic/space-before-function-paren ['error', 'always'] packages/eslint-config

Verify

git clean -xfd
npm ci
npm run lint
npm test

Reference

with fallback to:

@MikeMcC399

This comment was marked as outdated.

remove dependencies
standard
prettier-standard

add dependencies
eslint@9.34.0
eslint-plugin-mocha@11.1.0
@stylistic/eslint-plugin@5.3.1
globals@16.3.0

add ESLint rules and lint JavaScript source code
@MikeMcC399 MikeMcC399 force-pushed the migrate/standard-to-eslint branch from c8292db to 7d94a78 Compare September 2, 2025 17:12
@MikeMcC399 MikeMcC399 marked this pull request as ready for review September 2, 2025 17:15
@MikeMcC399
Copy link
Contributor Author

@AtofStryker

This PR migrates to a current ESLint linting framework and, in doing so, knocks 11 vulnerabilities off the list, including 2 critical. It however still leaves:

43 vulnerabilities (4 low, 10 moderate, 11 high, 18 critical)

even when it's done, so there will be more PRs after this one!

Please review and merge, as you have kindly done previously!

@AtofStryker AtofStryker merged commit 3670e0a into cypress-io:master Sep 4, 2025
1 check passed
@MikeMcC399 MikeMcC399 deleted the migrate/standard-to-eslint branch September 4, 2025 06:09
@MikeMcC399 MikeMcC399 mentioned this pull request Sep 4, 2025
Copy link

🎉 This PR is included in version 2.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants