Skip to content

feat(editorconfig): support EditorConfig for all configuration #1054

@eamonburns

Description

@eamonburns

It is annoying having to try to keep .editorconfig and .stylua.toml in sync for rules that they share.

I would like to define all configuration for StyLua in an .editorconfig file.

ReSharper (JetBrains editor for C#)

  • Has a custom resharper_* prefix for editor-specific rules
  • Respects more widely-used csharp_* and dotnet_* prefixes

Proposal

Read EditorConfig rules prefixed with stylua_* from .editorconfig files.

Would convert this:

syntax = "All"
column_width = 120
line_endings = "Unix"
indent_type = "Tabs"
indent_width = 4
quote_style = "AutoPreferDouble"
call_parentheses = "Always"
collapse_simple_statement = "Never"
space_after_function_names = "Never"
block_newline_gaps = "Never"

[sort_requires]
enabled = false

To this:

[*.lua]
stylua_syntax = All
max_line_length = 120
end_of_line = lf
indent_style = tab
indent_size = 2
stylua_quote_style = AutoPreferDouble
stylua_call_parentheses = Always
stylua_collapse_simple_statement = Never
stylua_space_after_function_names = Never
stylua_block_newline_gaps = Never

# Note: [sort_requires] section removed
stylua_sort_requires_enabled = false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions