Skip to content
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

Why require name in the top-level package.json? #62

Closed
bakkot opened this issue Jun 5, 2023 · 2 comments · Fixed by #64
Closed

Why require name in the top-level package.json? #62

bakkot opened this issue Jun 5, 2023 · 2 comments · Fixed by #64

Comments

@bakkot
Copy link
Contributor

bakkot commented Jun 5, 2023

This code prevents you from running this tool when your top-level package.json has an empty name field. There's a note saying this shouldn't matter because "npm won't let a package without name be published", but when I'm running against a local directory, my top-level package.json isn't something which is necessarily going to be published.

Concretely, my workflow for local projects is usually echo '{}' > package.json; npm i stuff. That all works fine without a name field. I wouldn't add a name unless I was actually going to publish on npm.

@dmail
Copy link
Member

dmail commented Jun 5, 2023

It looks like the check + warning happens too soon and might be delayed to where package.name is required. At least the root package should be allowed to have no name

@dmail
Copy link
Member

dmail commented Jun 5, 2023

I'm planning to work on this during the week

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 a pull request may close this issue.

2 participants