Skip to content

Update babel monorepo to v8 - #191

Merged
rubensworks merged 2 commits into
masterfrom
claude/jquery-widget-pr-188-edxhjk
Aug 20, 2026
Merged

rubensworks merged 2 commits into
masterfrom
claude/jquery-widget-pr-188-edxhjk

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Supersedes #188, which was green everywhere except lint.

Why #188 failed

Babel 8 packages are ESM-only, and ESLint 7 loads parsers with require():

/home/runner/work/jQuery-Widget.js/jQuery-Widget.js/node_modules/@babel/eslint-parser/lib/index.js:1
(function (exports, require, module, __filename, __dirname) { import { types, version } from '@babel/core';
                                                              ^^^^^^
SyntaxError: Cannot use import statement outside a module

@babel/eslint-parser@8 also declares eslint@^9.0.0 || ^10.0.0 as a peer dependency, so the babel bump cannot land without moving off ESLint 7.

Changes

  • @babel/core and @babel/preset-env to ^8.0.0, @babel/eslint-parser to ^8.0.0 (same as Update babel monorepo to v8聽#188).
  • eslint to ^9.0.0, plus globals as a dev dependency.
  • .eslintrc replaced by an eslint.config.mjs flat config. All rules are carried over unchanged, except:
    • valid-jsdoc was dropped, as ESLint 9 removed the rule. It was already disabled (0).
    • env: { es6, node, browser } became the equivalent languageOptions.globals spreads of the globals package.
    • comma-dangle is now spelled out per syntax kind. The always-multiline shorthand used to leave function calls unchecked because the config targeted an ES version below 2017; with ecmaVersion: 'latest' the shorthand would newly flag call sites, so functions: 'ignore' keeps the previous behaviour.
    • no-unused-vars gets caughtErrors: 'none', as ESLint 9 changed that default from none to all.

No source files needed changes.

Verification

Ran the full CI matrix locally on Node 22: yarn run lint, yarn run dev-ci, yarn run dev-prod-ci and yarn run build all succeed. Also confirmed the new lint config still reports errors (deliberately introduced no-unused-vars, semi-spacing and no-extra-semi violations were caught), so linting is not silently passing.


Generated by Claude Code

Babel 8 packages are ESM-only, which ESLint 7 cannot load: `eslint`
crashed with "Cannot use import statement outside a module" when
requiring `@babel/eslint-parser` v8. That parser also requires
ESLint 9 or later as a peer dependency.

Therefore, migrate linting to ESLint 9:
* Replace `.eslintrc` with an `eslint.config.mjs` flat config.
* Replace the `env` entries with the equivalent `globals` sets.
* Keep `comma-dangle` and `no-unused-vars` behaving as before, as
  ESLint 9 changed the defaults for trailing commas in function calls
  and for unused catch parameters.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TG9tcF6wTrvXjL6QEtsd2t
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Resolved the yarn.lock conflict by regenerating it from master's
lockfile, so the webpack-dev-server v6 update and the babel v8 and
ESLint 9 updates are all reflected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TG9tcF6wTrvXjL6QEtsd2t
@rubensworks
rubensworks merged commit 00b74a4 into master Aug 20, 2026
34 of 35 checks passed
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.

3 participants