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:
{
"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
:
{
"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
- Replace
true
with"explicit"
for all code actions - Maintain your other existing configuration settings
- 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:
- Preventing conflicts with multi-extension setups
- Clarifying the execution boundary for save actions
- 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:
- Check for user/workspace setting conflicts by pressing
Ctrl+Shift+P
> "Preferences: Open Settings (JSON)" - Disable any extensions that might modify ESLint settings (like "ESLint Auto Fix On Save")
Additional Resources
- Official VSCode release notes about this change:
VSCode 1.85.0 Release Notes - Migration guide for previous VSCode versions:
VSCode 1.83.0 Setting Changes