Source formatting #396
Closed
chriswilty
started this conversation in
Feature request
Replies: 1 comment
-
This is intentional. There is only one formatting and it is done by the rescript binary. I have absolutely no plan to implement a custom formatter in the plugin. so yes, an editorconfig file is useless. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Looks like the plugin is using rescript to do formatting (ResFormatProcess.java) which is fully opinionated about format and doesn't allow any user opinions about trailing commas, whitespace, indentation type or size, etc.
If a user has editorconfig set up, then I would assume that should be applied after rescript formatting, so should allow control over a few lightweight aspects of formatting such as indentation. However, that is not currently working - it seems editorconfig is being ignored for .res/.resi files. Is that a bug?
Maybe a better option for users who really care about formatting beyond editorconfig would be to try implementing a prettier plugin, similar to https://www.npmjs.com/package/prettier-plugin-reasonml. I might give that a go anyway, just for kicks - looks quite trivial.
Beta Was this translation helpful? Give feedback.
All reactions