Skip to content

fix: reject leading hyphens#156

Merged
hashtagchris merged 3 commits intomainfrom
hashtagchris-leading-dashes
Dec 18, 2025
Merged

fix: reject leading hyphens#156
hashtagchris merged 3 commits intomainfrom
hashtagchris-leading-dashes

Conversation

@hashtagchris
Copy link
Copy Markdown
Contributor

@hashtagchris hashtagchris commented Dec 17, 2025

Reject unscoped names with leading hypens (dashes). These package names are often interpreted as options on the command-line.

References

https://en.wikipedia.org/wiki/Hyphen-minus (I usually call them dashes)

@hashtagchris hashtagchris requested a review from a team as a code owner December 17, 2025 20:55
@hashtagchris hashtagchris force-pushed the hashtagchris-leading-dashes branch from 4a962c7 to b95e84e Compare December 17, 2025 20:57
Comment thread test/index.js
test('validate-npm-package-name', function () {
// Traditional

assert.deepStrictEqual(validate('validate-npm-package-name'), { validForNewPackages: true, validForOldPackages: true })
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If validate-npm-package-name isn't valid, we're in trouble. 😄

@hashtagchris hashtagchris merged commit 23f220d into main Dec 18, 2025
22 checks passed
@hashtagchris hashtagchris deleted the hashtagchris-leading-dashes branch December 18, 2025 20:00
@github-actions github-actions Bot mentioned this pull request Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants