Closed MikeMcC399 closed 4 months ago
ESLint 9.x identifies usages in the repo of unnecessary ESLint rule disables.
9.x
This affects the following instances:
/* eslint-disable-next-line no-console */ in
/* eslint-disable-next-line no-console */
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.
8.x
/* eslint-disable no-unused-vars */ in
/* eslint-disable no-unused-vars */
ESLint finds no unused variables in the marked section.
By temporarily updating to ESLint 9.x, unnecessary rule disables are identified and automatically removed by eslint --fix
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
This prepares the Cypress test specs so that they will pass linting when the repo is migrated to ESLint 9.x.
On Ubuntu 22.04.4 LTS, Node.js v20.12.2 LTS
22.04.4
v20.12.2
npm ci npm run lint npm run local:run
:tada: This PR is included in version 2.0.7 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
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 */
inThe ESLint no-console rule does not belong to the set of recommended rules in ESLint
8.x
or9.x
and so disabling it in-line was not necessary./* eslint-disable no-unused-vars */
inESLint finds no unused variables in the marked section.
Process
By temporarily updating to ESLint
9.x
, unnecessary rule disables are identified and automatically removed byeslint --fix
Run ESLint
9.x
:Revert to ESLint
8.x
and check that linting still works:Changes
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.jsv20.12.2
LTS