Skip to content

Upgrade dev dependencies and modernize the ESLint setup - #282

Merged
alex-friedl merged 2 commits into
masterfrom
dev/bump-dev-deps-majors
Nov 24, 2026
Merged

alex-friedl merged 2 commits into
masterfrom
dev/bump-dev-deps-majors

Conversation

@alex-friedl

@alex-friedl alex-friedl commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Upgrades the dev tooling to the current major versions and cleans up the ESLint setup. Nothing in the published package changes.

Dependency updates

  • chai 6 and dirty-chai 3
  • ESLint 10, plus @eslint/js, which ESLint no longer installs on its own
  • open-cli 9

eslint-plugin-import doesn'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 like src/sendFCM.js and src/push-notifications.js were never linted. The script now runs eslint . across the whole repo.

The config now follows current ESLint recommendations:

  • defineConfig and globalIgnores, with globals from the globals package instead of hand-written lists
  • eslint-plugin-n and eslint-plugin-promise for the library code, eslint-plugin-mocha for the tests
  • Import checks that also cover require() calls
  • Unused eslint-disable comments fail the lint
  • Prettier as its own check (prettier --check .) rather than running inside ESLint, as Prettier recommends

The old eslintConfig block in package.json is 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 now throw instead of returning Promise.reject(). The behaviour is the same. src/sendWNS.js gets two disable comments and a TODO, because its callback-based code deserves a proper rewrite rather than a lint workaround.

Prettier also reformatted .babelrc and .github/copilot-instructions.md, which it hadn't been checking before.

Left for later

  • sinon and sinon-chai, since sinon-chai 4 requires a newer sinon. Both move with the firebase-admin 14 and web-push 4 upgrade, which rewrites the test stubs anyway.
  • Babel 8, which gets its own PR

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

🤖 Generated with Claude Code

alex-friedl and others added 2 commits November 24, 2026 22:55
- 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>
@alex-friedl alex-friedl changed the title Bump dev dependencies to latest majors Bump dev dependencies to latest majors and modernize ESLint setup Nov 24, 2026
@alex-friedl alex-friedl changed the title Bump dev dependencies to latest majors and modernize ESLint setup Bump dev dependencies to latest majors, modernize ESLint setup Nov 24, 2026
@alex-friedl
alex-friedl merged commit f9d5ac0 into master Nov 24, 2026
8 checks passed
@alex-friedl alex-friedl changed the title Bump dev dependencies to latest majors, modernize ESLint setup Upgrade dev dependencies and modernize the ESLint setup Nov 24, 2026
@alex-friedl
alex-friedl deleted the dev/bump-dev-deps-majors branch November 24, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant