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

[Feat] keep empty line after HashBang #183

Open
Airkro opened this issue Sep 25, 2024 · 4 comments
Open

[Feat] keep empty line after HashBang #183

Airkro opened this issue Sep 25, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Airkro
Copy link

Airkro commented Sep 25, 2024

Is your feature request related to a problem?
Please describe a clear and concise description of what the problem is. E.g. I'm always frustrated when [...]

Currently, this plugin will remove empty line after HashBang.

  #!/usr/bin/env node
-                               
  import foo from 'bar';

Describe the solution you'd like
A clear and concise description of what you want to happen.

  • Keep an empty line after HashBang, if it exists.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

  • Enforce an empty line after HashBang.

Additional context
Add any other context or screenshots about the feature request here.

@fbartho
Copy link
Collaborator

fbartho commented Sep 25, 2024

I personally don’t see a problem with this feature change.

I think we already have a special case for shebang-lines, so it’s probably a small tweak to adjust this code.

The biggest problem is deciding if this is a breaking change from a versioning perspective.

@IanVS IanVS added the enhancement New feature or request label Sep 25, 2024
@IanVS
Copy link
Owner

IanVS commented Sep 25, 2024

I think it could be considered a "bugfix", though we might want to release in a minor. Even prettier itself allows formatting changes between versions. We should make our stance explicit in the README, though...

@Airkro
Copy link
Author

Airkro commented Sep 26, 2024

Add a new option to enable that feature, can avoid breaking change.

@IanVS
Copy link
Owner

IanVS commented Sep 26, 2024

Yes, but that's how we ended up with a bajillion options previously, and we worked hard to remove them. Prettier itself is opinionated and has very few options, and we want to follow that same philosophy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants