Repository navigation
Update babel monorepo to v8 - #191
Merged
Merged
Conversation
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
|
|
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
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.
Supersedes #188, which was green everywhere except
lint.Why #188 failed
Babel 8 packages are ESM-only, and ESLint 7 loads parsers with
require():@babel/eslint-parser@8also declareseslint@^9.0.0 || ^10.0.0as a peer dependency, so the babel bump cannot land without moving off ESLint 7.Changes
@babel/coreand@babel/preset-envto^8.0.0,@babel/eslint-parserto^8.0.0(same as Update babel monorepo to v8聽#188).eslintto^9.0.0, plusglobalsas a dev dependency..eslintrcreplaced by aneslint.config.mjsflat config. All rules are carried over unchanged, except:valid-jsdocwas dropped, as ESLint 9 removed the rule. It was already disabled (0).env: { es6, node, browser }became the equivalentlanguageOptions.globalsspreads of theglobalspackage.comma-dangleis now spelled out per syntax kind. Thealways-multilineshorthand used to leave function calls unchecked because the config targeted an ES version below 2017; withecmaVersion: 'latest'the shorthand would newly flag call sites, sofunctions: 'ignore'keeps the previous behaviour.no-unused-varsgetscaughtErrors: 'none', as ESLint 9 changed that default fromnonetoall.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-ciandyarn run buildall succeed. Also confirmed the new lint config still reports errors (deliberately introducedno-unused-vars,semi-spacingandno-extra-semiviolations were caught), so linting is not silently passing.Generated by Claude Code