withastro / language-tools

Language tools for Astro
MIT License
268 stars 53 forks source link

💡 RFC: EditorConfig compatibility #729

Closed cdtut closed 3 months ago

cdtut commented 10 months ago

Background & Motivation

EditorConfig is very convenient standard for setting indent style and to trim trailing whitespace to do minimal formatting during saving. It is also standard that work in lots of editors.

Can new setting be added to disable prettier formatting? Only way to disable it is disable all formatting. But then have to spend lots of time changing indent and trim trailing whitespace in manual way because no formatting is possible.

If new setting is there then it is possible to disable prettier but EditorConfig extension can still do its useful formatting which helps a lot.

Proposed Solution

Possible solutions

New setting to disable prettier in astro files but compatible with EditorConfig settings.

Detailed Design

No response

Help make it happen!

rogama25 commented 8 months ago

A similar thing happens to me, I want to keep my indentations to 2 spaces but the Astro plugin keeps formatting it to 4 spaces. Seems to ignore the tab_width setting even though Prettier documentation explicitly says that is supported here