-
-
Notifications
You must be signed in to change notification settings - Fork 4
feat: show warning for dist tags #38
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
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new diagnostic rule that warns when dependency versions use dist-tags (e.g. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/utils/package.ts (1)
17-31:⚠️ Potential issue | 🟡 MinorFix false positives for v-prefixed semver versions in dist-tag detection.
The current pattern treats any alpha-leading token as a dist tag. Since
parseVersion()does not strip the leadingv, a pinned version likev1.2.3would match and trigger an incorrect warning (npm's semver parser accepts and strips thevprefix, but this code does not). Users would see a misleading message claiming a specific version is a distribution tag.Adjust the pattern to exclude v-prefixed semver strings:
Suggested fix
-const DIST_TAG_PATTERN = /^[a-z][\w.-]*$/i +// Exclude v-prefixed semver to avoid false positives (e.g., "v1.2.3"). +const DIST_TAG_PATTERN = /^(?!v?\d+\.\d+\.\d+(?:[-+][\w.-]+)?$)[a-z][\w.-]*$/i
|
Thanks! Can you please resolve the conflicts and check if #38 (review) is valid? |
ad02f02 to
fed7ce7
Compare
|
I'm not sure if we really need to warn about versions that aren't in dist‑tags. It's hard for us to decide when it's actually a problem. 🤔 |
Closes #37