Everyday Toolkit

Stop VS Code Auto Formatting: Simple Solutions for Control

Published 2026-07-27

Updated Jul 2026

Some links on this page are affiliate links. If you buy through them we may earn a small commission at no extra cost to you. We only recommend what we'd use.

Key takeaways
  • Turn off formatOnSave globally or per workspace, configure language-specific formatting rules, manage Prettier and ESLint extension triggers, fix conflicting formatter issues.
Stop VS Code Auto Formatting: Simple Solutions for Control
Photo: Software: Alliance for Open Media Screenshot: Veikk0.ma via Wikimedia Commons

Understanding VS Code's Auto Formatting

VS Code auto-formatting rewrites your code layout according to configured style rules every time you save, paste, or type. While designed to maintain clean code, it often overrides custom spacing, conflicts with team linter rules, or rewrites messy legacy files against your intentions, making manual control far preferable in complex workflows.

🛍 Ready to buy? Check current prices on Amazon for the picks in this guide.

The editor relies on background hooks attached to events like file saves or line completions. When triggered, it passes your active file buffer through either its built-in engine or a third-party extension. While useful for rapid prototyping, automated restyling can disrupt your momentum if you are working within strict boundaries or dealing with mixed codebases.

Why Might You Want to Disable Auto Format?

Developers turn off auto-formatting to prevent unexpected code churn, resolve conflicts between different formatting tools, and protect custom code alignment. When working on legacy codebases or strict team projects, automated formatting can generate huge Git diffs by modifying lines you never intended to edit, making pull reviews painful.

Beyond version control noise, automatic layout tools frequently collide with custom aesthetic choices, such as specific array alignments or long method chains. Disabling automatic execution puts you back in charge, allowing you to trigger formatting manually (`Shift+Alt+F` on Windows/Linux or `Option+Shift+F` on macOS) only when you actually want it.

Global Disabling: Turning Off Auto Format Entirely

Stop VS Code Auto Formatting: Simple Solutions for Control
Photo: Bouchard, Charles Jacques, 1837-1915 Oliver, Thomas, Sir, 18 via Wikimedia Commons

Disabling auto-formatting globally turns off automatic code adjustments across every project you open in VS Code. It is the quickest fix if you prefer total manual control or want to stop unexpected saves from altering files, though workspace-level tweaks often offer better flexibility for active project workflows.

Shutting off formatting at the global user level sets a baseline default across your entire machine. Every window, folder, and isolated file opened in VS Code will respect these master rules unless a specific project configuration explicitly overrides them.

How to Disable Globally

To disable formatting globally, open Settings via Ctrl+, (or Cmd+, on macOS), search for editor.formatOnSave, and uncheck the box. You should also search for and uncheck editor.formatOnType and editor.formatOnPaste to completely shut down background auto-formatting across all active files in VS Code.

If you prefer editing configuration files directly instead of navigating the graphical interface, press Ctrl+Shift+P (or Cmd+Shift+P), type "Open User Settings (JSON)", and press Enter. Inside the main brackets, add or update the following settings:

{
  "editor.formatOnSave": false,
  "editor.formatOnType": false,
  "editor.formatOnPaste": false
}

Workspace-Specific Disabling: Project-Level Control

Workspace settings disable auto-formatting for a specific project folder while leaving your global preferences intact elsewhere. This targeted approach prevents conflicts on shared team repositories that rely on manual formatting, letting you safely retain auto-formatting in your personal projects without breaking team code style guidelines.

By defining settings inside a repository, team members inherit consistent rules without altering their personal editor configurations. This isolates legacy software or strict client repositories from your personal preferences.

How to Disable for a Workspace

Open your project in VS Code, open Settings (Ctrl+, or Cmd+,), and click the "Workspace" tab at the top of the interface. Search for editor.formatOnSave and uncheck it. VS Code writes this preference directly to .vscode/settings.json, overriding your global user settings for this repository alone.

To commit these settings directly to version control for your team, ensure the .vscode/settings.json file includes the explicit flags:

{
  "editor.formatOnSave": false,
  "editor.formatOnType": false,
  "editor.formatOnPaste": false
}

Language-Specific Disabling: Fine-Grained Control

Language-specific disabling allows you to turn off automatic formatting for troublesome file types like Markdown or HTML while keeping it active for Python or TypeScript. This selective control prevents template engines or documentation files from getting scrambled while maintaining structured formatting where you actually want it.

Certain markup languages or templating syntax do not play well with generic formatters. Turning off auto-format for specific file extensions prevents broken line wraps or ruined whitespace indentation without forcing you to abandon auto-formatting for the rest of your stack.

How to Disable for a Language

To disable auto-formatting for a specific language, press Ctrl+Shift+P (or Cmd+Shift+P), type "Preferences: Configure Language Specific Settings", and select your target language. In the settings.json block that opens, add "editor.formatOnSave": false within the language block to stop auto-formatting for those files.

For example, to turn off automatic formatting specifically for Markdown and HTML files while leaving other files untouched, structure your JSON configuration like this:

{
  "[markdown]": {
    "editor.formatOnSave": false
  },
  "[html]": {
    "editor.formatOnSave": false
  }
}

Managing External Formatters: Prettier, ESLint, and Extensions

Built-in VS Code settings might not stop formatting if external extensions like Prettier or ESLint actively enforce rules on save. Managing these tools requires either disabling their dedicated extension settings, removing their save hooks in .vscode/settings.json, or configuring project-level ignore files to prevent them from scanning your files.

Linter extensions often run independent code-action triggers that operate outside standard editor settings. Understanding how these extensions interact with VS Code helps you fully suppress unwanted file adjustments.

Disabling Prettier in VS Code

To disable Prettier, you can set "editor.defaultFormatter": "null" in your settings, disable the Prettier extension in VS Code, or add a .prettierignore file to your project root containing *. This prevents Prettier from intercepting file saves and forcing its rigid formatting rules onto your codebase.

If Prettier keeps formatting despite global settings, check whether it is assigned as the default document formatter. Override it in your JSON config with:

{
  "editor.defaultFormatter": null
}

Disabling ESLint Auto-Fixing

ESLint usually formats code through its auto-fix action rather than standard formatting settings. To disable this behavior, open your VS Code settings, search for editor.codeActionsOnSave, and remove "source.fixAll.eslint": "always" or set it to "explicit" so ESLint stops automatically tweaking your code when saving files.

Your settings.json entry for controlling ESLint auto-fixing should look like this:

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  }
}

Troubleshooting Persistent Formatting Issues

If VS Code continues to reformat code after disabling formatOnSave, active extensions or conflicting extension settings are likely overruling your main configuration. Identifying the culprit requires checking your active formatter setting, reviewing extension dependencies, and searching settings JSON files for hidden language overrides that take priority.

Settings in VS Code follow a strict hierarchy: Language-Specific Settings > Workspace Settings > User Settings > Default Settings. A single language block in a hidden workspace file can silently override your global user settings.

Resolving Conflicting Formatters

When multiple formatters run simultaneously, they overwrite each other's work and cause unexpected formatting bugs. Resolve this by opening a file in the affected language, pressing Ctrl+Shift+P (or Cmd+Shift+P), selecting "Format Document With...", and choosing "Configure Default Formatter..." to pick a single primary tool.

Assigning an explicit formatter eliminates ambiguity, ensuring VS Code never attempts to run two distinct engines on the same file during manual or automatic triggers.

Identifing Extension Conflicts

Extensions for specific frameworks like Tailwind, Vue, or Python often bundle their own internal formatters that bypass global settings. To isolate problematic plugins, disable third-party formatting extensions individually in the Extensions view (Ctrl+Shift+X) or start VS Code in extension-free mode to pinpoint which plugin causes unwanted reformatting.

You can launch VS Code without active extensions from your terminal to quickly test your baseline behavior:

code --disable-extensions

Choosing between formatters depends on whether you need strict style enforcement or light structural consistency across environments. While Prettier handles syntax layout with zero configuration, ESLint catches logical errors, and EditorConfig provides low-overhead indent rules across different text editors without forcing aggressive code restyling on save.

Tool Best For Pricing Tier Key Advantage
Prettier Opinionated code layout across web languages Free / Open Source Zero-configuration consistency
ESLint JavaScript/TypeScript code quality and safety Free / Open Source 🛍 See today's best prices on Amazon and grab the option that fits you.

Editorial Team Author & reviewer

Hands-on reviewers testing tools, apps and services so you do not have to. Every article here is hands-on tested and human-reviewed before publishing.