Skip to content

fix(lint): fix ESLint config loading broken on Node.js 25#410

Merged
ALagoni97 merged 1 commit into
mainfrom
fix/eslint-node25-compat
Jul 14, 2026
Merged

fix(lint): fix ESLint config loading broken on Node.js 25#410
ALagoni97 merged 1 commit into
mainfrom
fix/eslint-node25-compat

Conversation

@ALagoni97

Copy link
Copy Markdown
Contributor

Summary

  • Renames .eslintrc.eslintrc.json so Node.js require() uses the JSON file loader instead of the JS module loader (Node 25 changed extensionless file handling, breaking JSON configs loaded as JS)
  • Removes a JS line comment (//) that was invalid JSON syntax
  • Adds ESLINT_USE_FLAT_CONFIG=false to lint scripts to prevent ESLint 8 from trying to ESM-import the config file in newer environments
  • Removes the explicit --config flag; ESLint auto-discovers .eslintrc.json by convention in legacy mode

Test plan

  • npm run lint passes cleanly (no config loading errors)
  • npm run lint:fix works as expected

🤖 Generated with Claude Code

Node.js 25 changed how extensionless files are loaded via require() — they
are now treated as JavaScript modules rather than JSON, causing the .eslintrc
file to fail with "Unexpected token ':'". Additionally, ESLint 8 in newer
environments tries to ESM-import config files passed via --config, which
breaks JSON loading.

Fixes:
- Rename .eslintrc → .eslintrc.json so require() uses the JSON loader
- Remove the JS line comment (invalid JSON) from the config
- Set ESLINT_USE_FLAT_CONFIG=false in lint scripts to force legacy config
  mode, preventing ESLint from trying to ESM-import the config file
- Remove explicit --config flag; ESLint discovers .eslintrc.json by convention

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ALagoni97 ALagoni97 requested a review from jonaslagoni as a code owner July 14, 2026 12:05
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
the-codegen-project Ready Ready Preview, Comment Jul 14, 2026 12:07pm
the-codegen-project-mcp Ready Ready Preview, Comment Jul 14, 2026 12:07pm

@jonaslagoni

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.74.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants