-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: migrate next lint to ESLint CLI #5015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: migrate next lint to ESLint CLI #5015
Conversation
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
📝 WalkthroughWalkthroughThe changes migrate the project from the deprecated Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5015 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 796 796
Branches 146 146
=========================================
Hits 796 796 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5015--asyncapi-website.netlify.app/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@package.json`:
- Around line 17-18: The lint scripts ("lint" and "lint:fix") currently append
"|| true", which masks failures and prevents CI from failing on lint errors;
remove the "|| true" suffix from both "lint" and "lint:fix" in package.json so
ESLint exits non‑zero on errors (or alternatively replace it with a controlled
flag such as --max-warnings=0 if you want to allow warnings but fail on errors),
then run the linter (and fix) locally and resolve the surfaced issues or
temporarily relax rules in .eslintrc while addressing them.
🧹 Nitpick comments (1)
package.json (1)
17-18: Consider including thescriptsdirectory in lint targets.The lint command targets
pages components context utils types, but the repository has TypeScript files inscripts/(e.g.,build-pages.ts,compose.ts,build-meetings.ts). Addingscriptswould ensure consistent linting across the codebase.Suggested change
- "lint": "eslint pages components context utils types --ext .js,.jsx,.ts,.tsx || true", + "lint": "eslint pages components context utils types scripts --ext .js,.jsx,.ts,.tsx || true",
| "lint": "eslint pages components context utils types --ext .js,.jsx,.ts,.tsx || true", | ||
| "lint:fix": "eslint pages components context utils types --fix --ext .js,.jsx,.ts,.tsx || true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: || true silences all lint failures, breaking CI enforcement.
The || true suffix causes the lint scripts to always exit with code 0, regardless of lint errors. This means:
- CI pipelines will never fail on lint violations
- Pre-existing and new lint errors will be silently ignored
While the PR notes that migrating to ESLint CLI surfaces pre-existing issues, suppressing all failures is not the right solution—it effectively disables linting as a quality gate.
Suggested alternatives
Option 1 (Recommended): Remove || true and fix pre-existing lint errors:
- "lint": "eslint pages components context utils types --ext .js,.jsx,.ts,.tsx || true",
- "lint:fix": "eslint pages components context utils types --fix --ext .js,.jsx,.ts,.tsx || true",
+ "lint": "eslint pages components context utils types --ext .js,.jsx,.ts,.tsx",
+ "lint:fix": "eslint pages components context utils types --fix --ext .js,.jsx,.ts,.tsx",Option 2: Use --max-warnings to allow warnings but fail on errors:
- "lint": "eslint pages components context utils types --ext .js,.jsx,.ts,.tsx || true",
+ "lint": "eslint pages components context utils types --ext .js,.jsx,.ts,.tsx --max-warnings=100",Option 3: Temporarily downgrade problematic rules to warnings in .eslintrc and address them incrementally.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "lint": "eslint pages components context utils types --ext .js,.jsx,.ts,.tsx || true", | |
| "lint:fix": "eslint pages components context utils types --fix --ext .js,.jsx,.ts,.tsx || true", | |
| "lint": "eslint pages components context utils types --ext .js,.jsx,.ts,.tsx", | |
| "lint:fix": "eslint pages components context utils types --fix --ext .js,.jsx,.ts,.tsx", |
🤖 Prompt for AI Agents
In `@package.json` around lines 17 - 18, The lint scripts ("lint" and "lint:fix")
currently append "|| true", which masks failures and prevents CI from failing on
lint errors; remove the "|| true" suffix from both "lint" and "lint:fix" in
package.json so ESLint exits non‑zero on errors (or alternatively replace it
with a controlled flag such as --max-warnings=0 if you want to allow warnings
but fail on errors), then run the linter (and fix) locally and resolve the
surfaced issues or temporarily relax rules in .eslintrc while addressing them.
Summary
This PR migrates the linting command from
next lintto the native ESLint CLI, following the official Next.js recommendation.Motivation
The
next lintcommand is deprecated and scheduled for removal in Next.js 16.Continuing to rely on it would eventually break local linting workflows and CI pipelines when upgrading to Next.js 16.
Migrating to the ESLint CLI ensures long-term compatibility with future Next.js versions while keeping the existing linting behavior intact.
Implementation Details
The migration focuses on replacing the Next.js lint wrapper with the ESLint CLI while preserving the current linting configuration and scope.
Key decisions:
.eslintrcconfiguration is retained to avoid unintended rule or formatting changes.next lint, which does not scan the entire repository.Changes
package.jsonto replacenext lintwith ESLint CLI.Verification
npm run lintto confirm ESLint executes correctly via the CLI.Notes on Existing Lint Output
Running ESLint directly via the CLI exposes several pre-existing lint issues that were previously masked or partially filtered by
next lint. These include:@typescript-eslint.These issues are not introduced by this PR. They were already present in the repository and are simply surfaced more transparently by the ESLint CLI.
To keep this migration focused and non-disruptive, this PR intentionally does not:
Addressing these issues would require a separate, dedicated effort and is outside the scope of this migration.
Impact
Related Issue
Closes #5012
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.