-
Notifications
You must be signed in to change notification settings - Fork 39
feat: add arg to prevent exit code 1 #2406
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: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR adds a --noExitCode flag to the react-detect tool to prevent it from exiting with code 1 when React 19 issues are detected. This is useful for local plugin scanning where non-zero exit codes are undesirable in certain workflows.
Changes:
- Added
noExitCodeboolean argument to the CLI argument parser - Implemented early exit with code 0 when
--noExitCodeflag is set
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/react-detect/src/bin/run.ts | Added noExitCode to the boolean arguments list and default configuration |
| packages/react-detect/src/commands/detect19.ts | Added conditional early exit with code 0 when noExitCode flag is present |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (argv.noExitCode) { | ||
| process.exit(0); | ||
| } | ||
|
|
||
| process.exit(results.summary.totalIssues > 0 ? 1 : 0); |
Copilot
AI
Jan 16, 2026
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.
The noExitCode flag implementation doesn't affect the error path. When an exception is caught on line 68-74, the process still exits with code 1 regardless of the noExitCode flag. The flag should also apply to error cases to be consistent with its purpose of preventing exit code 1.
| if (argv.noExitCode) { | ||
| process.exit(0); | ||
| } |
Copilot
AI
Jan 16, 2026
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.
The flag name noExitCode is ambiguous - it suggests preventing all exit codes, when it actually only prevents exit code 1. Consider renaming to noErrorExitCode or ignoreErrors to better reflect its actual behavior.
What this PR does / why we need it:
Whilst scanning plugins locally it's handy to not have to deal with error exit codes.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
📦 Published PR as canary version:
Canary Versions✨ Test out this PR locally via:
npm install website@5.3.0-canary.2406.21076281185.0 npm install @grafana/react-detect@0.5.0-canary.2406.21076281185.0 # or yarn add website@5.3.0-canary.2406.21076281185.0 yarn add @grafana/react-detect@0.5.0-canary.2406.21076281185.0