Feature: Fall back to .editorconfig even when stylua.toml is present
Problem
When both stylua.toml and .editorconfig files are present, StyLua only uses the config options from stylua.toml.
For example, with the following two files:
stylua.toml
quote_style = "AutoPreferSingle"
.editorconfig
root = true
[*.lua]
indent_style = space
indent_size = 2
StyLua would only use the quote_style option from stylua.toml and ignore the options set in .editorconfig, falling back to the default of 4 space tabs.
Requested Behavior
I propose that config options are applied in decreasing priority:
- From
stylua.toml - From
.editorconfig - From the default configuration
In the example above, this would set quote_style to AutoPreferSingle, while also setting indent_type to Spaces and indent_width to 2.
This will prevent duplicate config options from being written, and prevent forgetting to update a config option in one file after changing the option in another file. Plus, Prettier (formatter for HTML/CSS/JS/Others) also follows this behavior.