Skip to content

Disable dart format on save for VSCode contributors #122050

@timsneath

Description

@timsneath

We should add a default workspace settings file for VSCode (one of the primary editors used by Flutter contributors) to ensure that it doesn't format on save by default while contributors are making changes to the Flutter repository.

It's frustratingly common that someone makes a good change, saves it, and then realizes to their horror that they have reformatted the entire class file. They then have to go through and revert the formatting changes while retaining the semantic changes they've made, a time-consuming and somewhat error-prone process. Adding this file to override the default VSCode settings will remove one tripwire for new contributors to the project.

While the .vscode folder is ignored using .gitignore today, adding an exclusion for settings.json is a best practice when it contains values that are intended to be enforced by a project (e.g. formatting). This is also documented by the VSCode team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: contributor-productivityTeam-specific productivity, code health, technical debt.c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions