Repository navigation
Upgrade dev dependencies and modernize the ESLint setup - #282
Merged
Merged
Conversation
- chai 4 -> 6, dirty-chai 2 -> 3 - eslint 9 -> 10, with @eslint/js added explicitly (no longer bundled) - eslint-plugin-import -> eslint-plugin-import-x (import has no ESLint 10 support) - open-cli 8 -> 9 sinon/sinon-chai and Babel 8 are left for separate changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Lint with `eslint .`: the old unquoted `{src,test}/**/*.js` glob only
matched files one directory deep, so half of src/ and test/ were skipped
- Use defineConfig/globalIgnores, the `globals` package and the default
(latest) ecmaVersion; report unused disable directives as errors
- Add eslint-plugin-n and eslint-plugin-promise for src/, eslint-plugin-mocha
for tests, and import-x recommended rules (now also checking require())
- Run Prettier on its own (`prettier --check .`) with eslint-config-prettier
instead of eslint-plugin-prettier
- Remove the legacy `eslintConfig` block from package.json
- Fix the findings: chai namespace import, duplicate test title, stale
disable comments, `throw` instead of `return Promise.reject()` in catch
handlers, Prettier formatting of .babelrc and copilot-instructions.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades the dev tooling to the current major versions and cleans up the ESLint setup. Nothing in the published package changes.
Dependency updates
@eslint/js, which ESLint no longer installs on its owneslint-plugin-importdoesn't support ESLint 10, so it's replaced by its maintained fork,eslint-plugin-import-x. The rules stay the same.Linting
The old lint script only covered about half of the code. Its glob,
{src,test}/**/*.js, wasn't quoted, so the shell expanded it and only matched files exactly one folder deep. Files likesrc/sendFCM.jsandsrc/push-notifications.jswere never linted. The script now runseslint .across the whole repo.The config now follows current ESLint recommendations:
defineConfigandglobalIgnores, with globals from theglobalspackage instead of hand-written listseslint-plugin-nandeslint-plugin-promisefor the library code,eslint-plugin-mochafor the testsrequire()callseslint-disablecomments fail the lintprettier --check .) rather than running inside ESLint, as Prettier recommendsThe old
eslintConfigblock inpackage.jsonis removed, since flat config ignores it.Fixes for what the new rules found
Mostly small things in the tests: chai 6 needs
import * as chai, one test title was duplicated, and two disable comments no longer did anything.In
src/push-notifications.js, two catch handlers nowthrowinstead of returningPromise.reject(). The behaviour is the same.src/sendWNS.jsgets two disable comments and a TODO, because its callback-based code deserves a proper rewrite rather than a lint workaround.Prettier also reformatted
.babelrcand.github/copilot-instructions.md, which it hadn't been checking before.Left for later
Testing
All 95 tests pass, lint is clean on Node 20 and 24, and the build works. CI passes on Node 20, 22, 24 and 26.
The new rules were also checked against deliberate mistakes: an import of a missing package and a dev dependency used in
src/are both reported now. Neither was caught before.Before merging
src/sendWNS.js. Merging Fix double callback call and WNS send bugs #285 first is simplest; this PR then needs a small rebase.🤖 Generated with Claude Code