stevearc / conform.nvim

Lightweight yet powerful formatter plugin for Neovim
MIT License
2.72k stars 142 forks source link

feature request: #346

Closed helderberto closed 4 months ago

helderberto commented 4 months ago

Did you check existing requests?

Describe the feature

Which configuration? Filetype: .lua Conform Version: Latest version

Expected behavior

Having an option out of the box, to switch between Prettier and Eslint to format files on saving, making it easiert to configure a autocommand which works for both tools.

Provide background

I am trying to format files like .tsx, .jsx, .js, .ts on save, and use the tool configured into the project (Eslint or Prettier).

What is the significance of this feature?

strongly desired

Additional details

No response

stevearc commented 4 months ago

All the building blocks for this are already there. For example, this recipe to make a command that toggles format-on-save could easily be repurposed to change which formatters you're using for a particular filetype. The only tricky part would be figuring out when you want to use one tool vs the other, but once you figure that out it should be straightforward to either automatically choose the right one or set up a manual toggle.

helderberto commented 4 months ago

All the building blocks for this are already there. For example, this recipe to make a command that toggles format-on-save could easily be repurposed to change which formatters you're using for a particular filetype. The only tricky part would be figuring out when you want to use one tool vs the other, but once you figure that out it should be straightforward to either automatically choose the right one or set up a manual toggle.

Thank you for the quick reply!