fix(lint): fix ESLint config loading broken on Node.js 25#410
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
🎉 This PR is included in version 0.74.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
.eslintrc→.eslintrc.jsonso Node.jsrequire()uses the JSON file loader instead of the JS module loader (Node 25 changed extensionless file handling, breaking JSON configs loaded as JS)//) that was invalid JSON syntaxESLINT_USE_FLAT_CONFIG=falseto lint scripts to prevent ESLint 8 from trying to ESM-import the config file in newer environments--configflag; ESLint auto-discovers.eslintrc.jsonby convention in legacy modeTest plan
npm run lintpasses cleanly (no config loading errors)npm run lint:fixworks as expected🤖 Generated with Claude Code