You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prettier usually picks up the '.editorconfig'-File of the project. The following variables will be evaluated:
end_of_line
indent_style
indent_size/tab_width
max_line_length
As far as I can see the .editorconfig of the project is currently not being picked up. There's no way to configure spotless to explicitly use a .editorconfig-File. As workaround I currently reconfigure the desired properties:
<...>.config(prettierConfig)
val prettierConfig =mapOf("tabWidth" to 4, "printWidth" to 80)
So my proposal is to ideally support .editorconfig without dedicated config, as alternative the .editorconfig could be supplied as another configuration parameter.
changed the title [-]Make prettier pick up .editorconfig[/-][+]Prettier should pick up .editorconfig by default or via configuration[/+]on Apr 26, 2022
so that it could be taken into consideration for up-to-date checks. Probably you would have to declare something like prettier().editorConfig() to trigger a search for .editorconfig files in this or a parent directory.
Activity
[-]Make prettier pick up .editorconfig[/-][+]Prettier should pick up .editorconfig by default or via configuration[/+]nedtwigg commentedon Apr 27, 2022
This is correct. If it were being accounted for, it would have to be included as part of this class
spotless/lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java
Lines 61 to 66 in 3ec902c
so that it could be taken into consideration for up-to-date checks. Probably you would have to declare something like
prettier().editorConfig()
to trigger a search for.editorconfig
files in this or a parent directory.Happy to take a PR for such a feature.