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

Reformat files after adding or updating components #1180

Closed
cbenz opened this issue Jul 11, 2024 · 1 comment
Closed

Reformat files after adding or updating components #1180

cbenz opened this issue Jul 11, 2024 · 1 comment
Labels
type: feature Introduction of new functionality to the application

Comments

@cbenz
Copy link

cbenz commented Jul 11, 2024

Describe the feature

I'd like the CLI tool to run npm run format (if defined) so that I don't commit accidentally wrongly formatted files regarding to my formatting settings.

Currently I have to run npm run format manually, or using a dev tool like pre-config, but as I noticed that svelte-add does reformat files, I wanted to suggest it.

PS: your library is a life changer for productivity and learning, so thanks a lot!

@cbenz cbenz added the type: feature Introduction of new functionality to the application label Jul 11, 2024
@huntabyte
Copy link
Owner

Hey there, @cbenz. I appreciate the feature request! I'm not sure if this is something we want to do with this project, as it feels a bit too intrusive for a project that adds components to your lib.

svelte-add has the luxury of knowing when you have prettier installed, as installing it is part of its scope, but I don't even think it's a good idea that it runs formatting for you.

We have to ask the following questions:

  • does the user have prettier installed?
  • is the ui directory within a package inside a monorepo with prettier only installed at the root?
  • what is the format script the user uses
  • what if they aren't using prettier at all? Do we add checks for biome and any other formatter that pops up in the future?

You can see how much this adds, and we haven't even touched all the possibilities, so I don't think it's a good idea for these reasons. Perhaps we can revisit it in the future if something changes!

@huntabyte huntabyte closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants