Don't force "format on save" setting on contributors #31
+0
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
editor.formatOnSave
VS Code setting controls whether file are automatically formatted when saved.Checking a VS Code workspace settings configuration file into the repository with this setting enabled seems like it would increase the likelihood of contributions being properly formatted. Unfortunately, in this case it does just the opposite. The reason is that no formatter and configuration is provided, so VS Code formats the code according to
whatever formatter and configuration the contributor happens to have set up for TypeScript. In my case, that is Prettier, the default configuration of which causes extensive formatting changes on save.
This will result in the following scenarios:
Ideally, the infrastructure of the project would be set up to enforce standard code style compliance from contributions. But until that happens, it is best to remove this harmful setting.