-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
fix(create-app): improved package name validation #2772
Conversation
Looks great @Timsonrobl! Thanks for the PR Note: While testing I saw that names like |
suggestion (dx, if-minor): The
|
Is not perfect, it's quick and dirty. For example it would also change |
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.
I want to turn on https://eslint.org/docs/rules/quotes later, IMO you can safely use single-quotes now
Should quoting style changes be done in this PR though? |
Seems no 🙂 🤷 |
Description
This PR fixes some cases where current validation of package name in package.json introduced in 1dbf246 fails. Examples: names containing
&
,$
and@
not as part of scoped package name.Silent package name substitution replaced with additional prompt that only appears if project name is cannot be used as legal package name. As such in most cases users won't be bothered with additional prompt but in edge cases they will be made immediately aware of possible issues with their choice of project name and given control over substitution, while maintaining the ease of using automated character substitution.
Additional context
Currently implied validation creates possibility of creating malformed package.json that would fail to initialize with
yarn
command withWhat is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).