Skip to content

feat: add error message for unsupported commands/package managers#129

Merged
antfu merged 7 commits intoantfu-collective:mainfrom
Zeko369:some-refactors
Feb 13, 2023
Merged

feat: add error message for unsupported commands/package managers#129
antfu merged 7 commits intoantfu-collective:mainfrom
Zeko369:some-refactors

Conversation

@Zeko369
Copy link
Copy Markdown
Contributor

@Zeko369 Zeko369 commented Jan 18, 2023

  • Add vscode settings for default formatter / final newline (to match eslint)
  • Show an error message if the current pkg manager doesn't support a command

@Zeko369 Zeko369 mentioned this pull request Jan 19, 2023
@Zeko369 Zeko369 changed the title Show why a command errored out Feature: add error message for unsupported commands/package managers Jan 20, 2023
@Zeko369 Zeko369 marked this pull request as ready for review January 20, 2023 12:41
@antfu
Copy link
Copy Markdown
Member

antfu commented Jan 20, 2023

Can you explain why this is needed? Also please revert the config change, we are using eslint to format

@Zeko369
Copy link
Copy Markdown
Contributor Author

Zeko369 commented Jan 20, 2023

Currently if you select a command that's not supported by the package manager (upgrade in bun or upgrade-interactive in bun/npm, or a lot more stuff in deno #130) it just returns an error code without saying why

Example of main vs this branch

CleanShot 2023-01-20 at 14 22 16@2x

Regarding the config, a lot of people (me included) have vscode format on save by default, which causes all projects including this one to be formatted by prettier, which isn't something everyone likes (I've read your blogpost and mostly agree for the short line length but still it helps with formatting stuff), vscodes default formatter mostly fixes indents / newlines and matches the projects eslint config, so using it on save doesn't collide with eslint.

Also by default my vscode wasn't inserting new lines so why not set "project styleguides" for everyone using vscode? (since vscode with a prettier extension will format this project wrong and cause people to need to chakge the config, so why not make it work out of the box?)

@antfu
Copy link
Copy Markdown
Member

antfu commented Jan 20, 2023

I see. I am good with the error change.

About the config, it's not about opinions, you don't need to convince me as:

  • When working on someone else's project, contributors should respect the existing formats (e.g. they should disable the Prettier extension when working on non-prettier projects, vice versa)
  • It may be discussable via an issue first, but not directly in a feature PR.
  • PR should be single-purpose as possible.

@Zeko369
Copy link
Copy Markdown
Contributor Author

Zeko369 commented Jan 20, 2023

PR should be single-purpose as possible.

Agree 😅

It may be discussable via an issue first, but not directly in a feature PR.

Will open one later

When working on someone else's project, contributors should respect the existing formats (e.g. they should disable the Prettier extension when working on non-prettier projects, vice versa)

True, how about in this PR I revert config changes and gitignore .vscode/settings.json?

@Zeko369
Copy link
Copy Markdown
Contributor Author

Zeko369 commented Feb 7, 2023

Hey @antfu just wanted to check in if you could review this since I want to finish the other 2 PRs and they're based on this one

Comment thread .gitignore Outdated
@antfu antfu changed the title Feature: add error message for unsupported commands/package managers feat: add error message for unsupported commands/package managers Feb 13, 2023
@antfu antfu merged commit 1a7e9e4 into antfu-collective:main Feb 13, 2023
@Zeko369 Zeko369 deleted the some-refactors branch February 14, 2023 22:37
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