Skip to content

Move to ESLint 9 and flat config - #140

Merged
alistair3149 merged 1 commit into
masterfrom
alistair3149/eslint-9
Nov 12, 2026
Merged

alistair3149 merged 1 commit into
masterfrom
alistair3149/eslint-9

Conversation

@alistair3149

@alistair3149 alistair3149 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

eslint-config-wikimedia 0.33.1 supports ESLint 9 and flat config (T364065). This moves the extension onto them. Lint reports the same 24 warnings as before.

Human input

Goal and shape: goal from @alistair3149; shape Claude's.

  • Directions: @alistair3149 asked to move our extensions on eslint-config-wikimedia to ESLint 9 and, after merging the first such PR, asked for the rest.

Outcome: not reviewed by a human yet. Left for you: the .then() change in the mappings save flow, which no automated test covers, and a skim of the config.

Claude's calls

  • Not discussed with @alistair3149:
    • Keeping Grunt's ESLint task, on grunt-eslint 26, rather than a plain eslint npm script.
    • The server config for Gruntfile.js and eslint.config.js.
    • .done( a ).fail( b ) → .then( a, b ), rather than .then().catch() or a disable comment. With both handlers in one .then(), an exception in the success handler does not run the failure handler.
  • Not verified: the mappings save and remove flows in a browser.
  • Where your judgment helps: with .then(), the handlers run one tick later than with .done()/.fail(), and an exception inside one is logged by jQuery as a console warning instead of surfacing as an uncaught error. Nothing here waits on the timing; whether the error reporting change matters is your call.

Changes

  • Bump eslint-config-wikimedia 0.20.0 → 0.33.1 and grunt-eslint 23.0.0 → 26.0.0, and declare eslint 9.39.5, which eslint.config.js loads directly. grunt-eslint 27 bundles ESLint 10, which eslint-config-wikimedia does not support yet.
  • Replace .eslintrc.json and the eslintIgnore list in package.json with one eslint.config.js. wikimedia/client-es6 is now client/es6.
  • Gruntfile.js and eslint.config.js run in Node, so they get the server config instead of the client one. Gruntfile.js gets the 'use strict' that config requires, in place of a /* eslint-env node */ comment ESLint 9 ignores.
  • Drop the mediawiki/msg-doc: warn override, which is now the default.
  • Fix what the newer config reports in resources/ext.wikibase.rdf.js: callbacks become arrow functions (none uses this), and .done().fail() becomes .then() with both handlers.
Verification evidence
  • master (grunt-eslint 23, ESLint 7.32, config 0.20.0): 43 files, 0 errors, 24 warnings (17 no-jquery/no-global-selector, 7 no-jquery/no-class-state).
  • Config 0.33.1 alone, on ESLint 8.57 with .eslintrc.json: 45 files (adds .stylelintrc.json and codecov.yml); 6 prefer-arrow-callback and 2 no-jquery/no-done-fail errors; the same 24 warnings.
  • This branch: npm test passes. ESLint lints the same 45 files, with eslint.config.js in place of .eslintrc.json: 0 errors, the same 24 warnings.
  • --print-config from ESLint 8 (config bump alone) and ESLint 9:
    • resources/ext.wikibase.rdf.js: rules, globals, ecmaVersion, sourceType, parser and settings match, apart from ESLint 9's own eslint:recommended changes (added no-empty-static-block, no-new-native-nonconstructor, no-unused-private-class-members; dropped no-extra-semi, no-mixed-spaces-and-tabs, no-new-symbol).
    • Gruntfile.js: client/es6 → server config.
    • extension.json, i18n/en.json, package.json: Atomics and SharedArrayBuffer now defined, from ecmaVersion 2017; no effect on JSON.
  • Removing the mediawiki/msg-doc override leaves the printed config unchanged.
  • Clean npm install: one ESLint copy (9.39.5).
  • CI after rebasing onto master with Fix CI: update mediawiki-codesniffer to 52 #141 (runs 43316043170 and 43316054404): every job passes, including Linting (npm test on Node 22), code style, PHPStan and Psalm.

AI-authored — Claude Code, Opus 5.5, on a Professional Wiki account

eslint-config-wikimedia 0.33.1 supports ESLint 9 and flat config
(T364065). This moves the extension onto them. Lint reports the same 24
warnings as before.

- Bump eslint-config-wikimedia 0.20.0 → 0.33.1 and grunt-eslint
  23.0.0 → 26.0.0, and declare eslint 9.39.5, which eslint.config.js
  loads directly. grunt-eslint 27 bundles ESLint 10, which
  eslint-config-wikimedia does not support yet.
- Replace .eslintrc.json and the eslintIgnore list in package.json with
  one eslint.config.js. `wikimedia/client-es6` is now `client/es6`.
- Gruntfile.js and eslint.config.js run in Node, so they get the server
  config instead of the client one. Gruntfile.js gets the 'use strict'
  that config requires, in place of a `/* eslint-env node */` comment
  ESLint 9 ignores.
- Drop the `mediawiki/msg-doc: warn` override, which is now the default.
- Fix what the newer config reports in resources/ext.wikibase.rdf.js:
  callbacks become arrow functions (none uses `this`), and
  `.done().fail()` becomes `.then()` with both handlers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alistair3149
alistair3149 marked this pull request as ready for review November 12, 2026 22:03
@alistair3149
alistair3149 merged commit 7bd5426 into master Nov 12, 2026
16 checks passed
@alistair3149
alistair3149 deleted the alistair3149/eslint-9 branch November 12, 2026 22:03
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