StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

[Suggestion] Support .editorconfig

Open Adirelle opened this issue 4 years ago • 4 comments

Given that .editorconfig file provides some settings that are supported by stylua, it could be handy to read that file to avoid duplicating these settings.

Adirelle avatar Mar 11 '21 13:03 Adirelle

I believe the way prettier does this is to allow an option to defer to the .editorconfig file. Would probably be a good option here as well.

LastTalon avatar Mar 12 '21 01:03 LastTalon

Interesting idea, which might be nice to have.

I think I'll most likely support project-level editorconfig, rather than a global one, so that it is more noticeable what kind of settings are being used.

JohnnyMorganz avatar Mar 12 '21 20:03 JohnnyMorganz

I believe the way prettier does this is to allow an option to defer to the .editorconfig file. Would probably be a good option here as well.

editorconfig provides libraries for several languages, so prettier probably used the one for js.

Adirelle avatar Mar 13 '21 22:03 Adirelle

There seems to be a relatively new crate for parsing .editorconfig files which looks promising: https://github.com/TheDaemoness/ec4rs

This issue hasn't really been tackled yet since there wasn't great support for editorconfig files

JohnnyMorganz avatar Mar 25 '22 18:03 JohnnyMorganz