Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) fall back to FormattingOptions #554

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Sep 21, 2020

In case no prettier configs are found
#539

@jasonlyu123 what do you think? Is this change a change we want to make? It's a breaking change and might be confusing. On the other hand it's also confusing right now that your user settings are not used if you don't know of prettier. So I'm in favor of it.

Situation:
User does not have any prettier config (either through .prettierrc or through VSCode settings)

Before:
Prettier defaults of tabWidth and useTabs are used

After:
The FormattingOptions in the format request are used. These are usually the tabSize/insertSpaces editor settings.

In case no prettier configs are found
sveltejs#539

BREAKING CHANGE:
If user has no prettier config, he now gets the tab size / space/tabs-settings of his IDE, not the default prettier config
@jasonlyu123
Copy link
Member

I'm also in favor of it. By default tabSize and insertSpaces might be overridden by indentation detection. So maybe it would not affect many people on existing files. On new files, it would use editor settings for indentation so it probably won't affect much either.

@dummdidumm dummdidumm merged commit dd540d6 into sveltejs:master Sep 22, 2020
@dummdidumm dummdidumm deleted the formattingoptions-fallback branch September 22, 2020 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants