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

Clean up description parsing #256

Merged
merged 5 commits into from Feb 29, 2024

Conversation

tommy-mitchell
Copy link
Contributor

@tommy-mitchell tommy-mitchell commented Feb 28, 2024

Separating out from #252. Updates readme for description and help to match JSDoc, and adds note about defaulting to code 2 (#252 (comment)).

Probably shouldn't have written this to begin with:

description &&= help ? redent(`\n${description}\n`, options.helpIndent) : `\n${description}`;
help = `${description || ''}${help}\n`;

@@ -76,7 +78,7 @@ const buildResult = (options, parserOptions) => {
input,
flags,
unnormalizedFlags,
pkg: package_,
pkg: packageJson,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thoughts on renaming cli.pkg to package or packageJson?

Copy link
Owner

Choose a reason for hiding this comment

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

It cannot be package as it's a reserved keyword, so it cannot be destructured. But we could indeed make it packageJson.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hadn't considered the destructuring part, fair point. I'm ambivalent on the change, but feel free to add it to #233 if you'd like to change it (or just go for it). The consistency (and not having to rename variables) would be nice though.

@sindresorhus sindresorhus merged commit 97e8b20 into sindresorhus:main Feb 29, 2024
3 checks passed
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.

None yet

2 participants