Skip to content

fix(deps): upgrade eslint and plugins to 9.39.4#201701

Open
maxkoryukov wants to merge 5 commits intowwebjs:mainfrom
volebo:feat/deps-upgrade-eslint-10.mk
Open

fix(deps): upgrade eslint and plugins to 9.39.4#201701
maxkoryukov wants to merge 5 commits intowwebjs:mainfrom
volebo:feat/deps-upgrade-eslint-10.mk

Conversation

@maxkoryukov
Copy link
Copy Markdown
Contributor

Description

This PR changes (I hope) nothing in the package's code, but it upgrades the eslint to the newest v10.2.0 with the flat config structure.

Testing Summary

I converted the old .eslintrc.json and .eslintignore files into the newer "flat" format of eslint config - eslint.config.mjs.

.mjs for the config file - because today it is very common to share/copy/paste eslint configs and examples in ESM format.

In order to test - i took my previous PRs "as is" and applied npm run lint:fix - and the new 10.2.0 eslint fixed the code.

I've added @stylistic plugin as well, with its "recommended" config. Because of notes in the migration guide

ESLint has officially deprecated all built-in formatting and stylistic rules as of version 8.53.0

The "Prettier" integration is preserved, and as its documentation says - it is added to the end of the "flat" config (this way "Prettier" config overrides some options and make Eslint and Prettier work harmoniously)

Type of Change

  • Dependency change (package changes such as removals, upgrades, or additions)
  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-code change (documentation, README, etc.)

Checklist

  • My code follows the style guidelines of this project.
  • All new and existing tests pass (npm test).
  • Typings (e.g. index.d.ts) have been updated if necessary.
  • Usage examples (e.g. example.js) / documentation have been updated if applicable.

@github-actions github-actions bot added dependencies Dependency updates api changes API modifications tests Test related build Build system utility Utility code labels Apr 7, 2026
setup(client) {
this.client = client;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there are "stylistic changes":

  1. add empty lines
  2. add a <space> for inline comments
  3. replace unused err (or _, or other names) with ignoredError
  4. and there are two lines i didn't want to change - so i've added "eslint-ignore" to them

});

// eslint-disable-next-line mocha/no-skipped-tests
// eslint-disable-next-line mocha/no-pending-tests
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this rule was renamed in the newest versions of the eslint-mocha plugin

@github-actions github-actions bot added ci CI pipeline infra Infrastructure labels Apr 7, 2026
- uses: actions/checkout@v2
- name: Install node v14
uses: actions/setup-node@v2
- uses: actions/checkout@v4
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

and here are the most dangerous changes, because it affects the "Pipeline"

i've upgraded the task to use "actions@v4" and instead of using Node14 - Node24

because:

  1. it is linting, not "running the package"
  2. it is 2026;) and Node14 is "end of life" after Feb 16, 2023

Copy link
Copy Markdown
Member

@2hoch1 2hoch1 Apr 7, 2026

Choose a reason for hiding this comment

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

This workflow has been replaced by tests and will be removed in the future. #127111

Copy link
Copy Markdown
Contributor Author

@maxkoryukov maxkoryukov Apr 7, 2026

Choose a reason for hiding this comment

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

i needed to update it because the pipeline was failing

but i can remove it from the PR

i've updated the PR today, but i still didn't remove GH Action update

package.json Outdated
"chai-as-promised": "^7.1.1",
"dotenv": "^16.0.0",
"eslint": "^8.4.1",
"eslint": "^10.2.0",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using the latest version isn’t always the best choice. Downgrade to eslint@9.39.4 for a more stable release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

DONE!

@2hoch1 2hoch1 mentioned this pull request Apr 7, 2026
9 tasks
@maxkoryukov maxkoryukov force-pushed the feat/deps-upgrade-eslint-10.mk branch from 4db9fb4 to 38b8177 Compare April 7, 2026 19:10
@maxkoryukov
Copy link
Copy Markdown
Contributor Author

@2hoch1 thanks for reviewing so fast! and thanks for adding the #201702 (stale deps) - i didn't notice this bug

and i've downgraded eslint to @9.39.4

in order to test i put this whole repo into a "node:24" docker image without eslint pre-installed, ran npm i , ensured that npm run lint -- --version returns

eslint
9.39.4

and checked the linting output.

after fixing minor issues (some // eslint ignore aren't required for eslint@9), the linter stopped to show warnings - and i pushed the PR for a new review.

@2hoch1
Copy link
Copy Markdown
Member

2hoch1 commented Apr 7, 2026

Your changes to lint.yml are blocking the ESLint workflow. Reverting the change should fix it.

@maxkoryukov
Copy link
Copy Markdown
Contributor Author

maxkoryukov commented Apr 7, 2026

Your changes to lint.yml are blocking the ESLint workflow. Reverting the change should fix it.

without this changes the Action fails, and the whole PR is considered "failing"

but let me remove those changes from the PR

UPD: DONE

@maxkoryukov maxkoryukov force-pushed the feat/deps-upgrade-eslint-10.mk branch from 38b8177 to 1b099ce Compare April 7, 2026 20:31
@github-actions github-actions bot removed ci CI pipeline infra Infrastructure labels Apr 7, 2026
@maxkoryukov maxkoryukov changed the title fix(deps): upgrade eslint and plugins to 10.2.0 fix(deps): upgrade eslint and plugins to 9.39.4 Apr 7, 2026
BenyFilho
BenyFilho previously approved these changes Apr 7, 2026
@BenyFilho BenyFilho added the approved Confirmed by maintainers label Apr 7, 2026
@maxkoryukov
Copy link
Copy Markdown
Contributor Author

so, yes, i rolled back changes in the "gitlab actions" and now the "Lint/ Eslint(pull_request)" Check fails in the GH Actions

@BenyFilho BenyFilho dismissed their stale review April 7, 2026 20:40

Error, it was only to approve workflow

@BenyFilho BenyFilho removed the approved Confirmed by maintainers label Apr 7, 2026
@2hoch1
Copy link
Copy Markdown
Member

2hoch1 commented Apr 7, 2026

Your workflow didn’t run because you are a first‑time contributor.

The current error is caused by the lint.yml setup, since that workflow still uses Node@14 while @stylistic/eslint-plugin requires Node@18. That is why the tests workflow is passing but the lint workflow is failing.

You can try adjusting the lint.yml. The bump is in fact necessary, even if the workflow gets removed afterward.

import globals from 'globals';
import pluginEslintJs from '@eslint/js';
import pluginMocha from 'eslint-plugin-mocha';
import pluginStylistic from '@stylistic/eslint-plugin';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@stylistic/eslint-plugin may cause formatting conflicts with Prettier.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

for @stylistic/eslint-plugin

i was following this logic:

  • old eslint was 8.4.1, and the new is 9.39.4, and most stylistic rules were marked deprecated/or were removed from the eslint config. So, rules like "spaced-comment" "comma-dangle" "quotes", ... now live in @stylistic
  • in order to preserve the existing code style restrictions i've added @stylistic's "recommended" config, and tried to write bad code (i tested just a few rules: dangling commas, trailing spaces, quotes and spaces in comments) - and the config handled everything well
  • then i checked for conflicts with prettier:
    $ npx eslint-config-prettier src/
    > No rules that are unnecessary or conflict with Prettier were found.

also, i thought that @stylistic gives more tools (rules) for setting the "correct" code style, so instead of postponing the task of "add @Stylistic" to the config - i tested and already added it.

i don't mind removing @stylistic, but the remaining "@eslint/js/recommended" isn't really "restrictive enough". One can check its sources, and there are no "quotes" or "comma-*" rules. And this rules were enabled in the default eslint@8 config (if i'm not mistaken)

so, my goal was: keep the same config, avoid errors

please, ping me, if @stylistic should be removed - and i will update the PR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove @stylistic and only use prettier

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@maxkoryukov
Copy link
Copy Markdown
Contributor Author

Your workflow didn’t run because you are a first‑time contributor.

The current error is caused by the lint.yml setup, since that workflow still uses Node@14 while @stylistic/eslint-plugin requires Node@18. That is why the tests workflow is passing but the lint workflow is failing.

You can try adjusting the lint.yml. The bump is in fact necessary, even if the workflow gets removed afterward.

yep, I went through this whole process lint.yaml - broken - fixed - restricted - ...

So, i'm going to push that sent... lost, found, subjected to public inquiry, lost again, and finally buried in soft peat commit back ;)

the pipeline will be in the "unapproved changes"-state, that's completely out of my control - i don't need it, but the maintainers' help and participation will be required to resolve this.

Also: it is not @stylistic/.. that fails, it is espree (the core part of eslint). And even eslint 9.39.4 requires at least Node v18.18 - so removing @stylistic won't resolve this issue with GH Actions.

@github-actions github-actions bot added ci CI pipeline infra Infrastructure labels Apr 8, 2026
@maxkoryukov
Copy link
Copy Markdown
Contributor Author

ok, I pushed back the commit 38b8177 feat(repo): github actions - lint - use node v24

@maxkoryukov
Copy link
Copy Markdown
Contributor Author

@2hoch1

You can try adjusting the lint.yml. The bump is in fact necessary, even if the workflow gets removed afterward.

done

node-version: '24'
- name: Install dependencies
run: npm install
run: npm ci
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use npm install instead of npm ci

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

because it is linting (not runtime), so why not
to use the latest stable Node version
@maxkoryukov maxkoryukov force-pushed the feat/deps-upgrade-eslint-10.mk branch from 38b8177 to ad7b03c Compare April 12, 2026 10:50
@maxkoryukov
Copy link
Copy Markdown
Contributor Author

i think it is ready for another review:

  • removed @stylistic/eslint-config
  • fixed npm install (was npm ci)

and the branch seems to be "updated"

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

Labels

api changes API modifications build Build system ci CI pipeline dependencies Dependency updates infra Infrastructure tests Test related utility Utility code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants