You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't force "format on save" setting on contributors
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:
- Conscientious contributors waste time reverting unexpected diffs and figuring out how to prevent future ones
- Other contributors submit low quality contributions
- Maintainers waste time review contributions with large diffs unrelated to the proposal
- Conscientious maintainers waste time cajoling contributors into removing unrelated changes from their contributions
- Other maintainers allow large unrelated diffs to be introduced into the repository
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.
0 commit comments