Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clean unused eslint disables #837

Merged

Conversation

MikeMcC399
Copy link
Contributor

Issue

ESLint 9.x identifies usages in the repo of unnecessary ESLint rule disables.

This affects the following instances:

/* eslint-disable-next-line no-console */ in

The ESLint no-console rule does not belong to the set of recommended rules in ESLint 8.x or 9.x and so disabling it in-line was not necessary.

/* eslint-disable no-unused-vars */ in

ESLint finds no unused variables in the marked section.

Process

By temporarily updating to ESLint 9.x, unnecessary rule disables are identified and automatically removed by eslint --fix

Run ESLint 9.x:

npm ci
npm install eslint@9 --force
npm run lint

Revert to ESLint 8.x and check that linting still works:

git restore package.json package-lock.json
npm ci
npm run lint

Changes

  • Automatic fixes from ESLint are applied.
  • Additionally associated left-over blank lines are removed.

This prepares the Cypress test specs so that they will pass linting when the repo is migrated to ESLint 9.x.

Verification

On Ubuntu 22.04.4 LTS, Node.js v20.12.2 LTS

npm ci
npm run lint
npm run local:run

@cypress-app-bot
Copy link
Collaborator

@jennifer-shehane jennifer-shehane merged commit 3f38aa1 into cypress-io:master May 6, 2024
12 checks passed
@cypress-app-bot
Copy link
Collaborator

🎉 This PR is included in version 2.0.7 🎉

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.

None yet

3 participants