Skip to content

VSCode Workspace Settings Changing to explicit

Problem Statement

When working with ESLint, Prettier, and Vite in a React project, you've configured your VSCode workspace settings (settings.json) to automatically fix ESLint errors and organize imports on save. Your configuration includes:

json
{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.organizeImports": true
  }
}

However, these settings automatically change to "explicit" without manual intervention. This occurs when:

  • Launching VSCode
  • During coding sessions
  • When saving files

This change prevents automatic ESLint fixes and import organization, disrupting your development workflow despite correctly configured:

  • ESLint rules (.eslintrc.cjs)
  • Prettier configuration (.prettierrc.json)
  • Package dependencies

Solution

The root cause is a breaking change in VSCode version 1.85.0 and later. Prior to this version, boolean values (true/false) weresupported for editor.codeActionsOnSave settings. Since 1.85.0, these settings must use string values, specifically "explicit" or "never".

Updated Configuration

Modify your .vscode/settings.json to use "explicit" instead of true:

json
{
  "editor.codeActionsOnSave": {
    // Use "explicit" instead of boolean values
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "explicit"
  },
  "editor.formatOnSave": true,
  "editor.wordWrap": "on",
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

Key Changes

  1. Replace true with "explicit" for all code actions
  2. Maintain your other existing configuration settings
  3. Save the file - changes will persist across VSCode sessions

Explanation

Why This Happens

VSCode automatically migrates deprecated settings to new formats:

  • VSCode 1.83.0 introduced "explicit" as an alternative option
  • VSCode 1.85.0 removed boolean support entirely
  • The migration occurs silently when VSCode detects legacy settings

What "explicit" Means

This value enables the requested action while:

  1. Preventing conflicts with multi-extension setups
  2. Clarifying the execution boundary for save actions
  3. Maintaining the same functionality as true in earlier versions

Important Considerations

TIP

Ensure all developers on your team update to VSCode 1.83.0 or higher to avoid configuration conflicts. Use .vscode/extensions.json to recommend consistent extensions across your team.

WARNING

If your settings revert after modification:

  1. Check for user/workspace setting conflicts by pressing Ctrl+Shift+P > "Preferences: Open Settings (JSON)"
  2. Disable any extensions that might modify ESLint settings (like "ESLint Auto Fix On Save")

Additional Resources