-
-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"prettier.configPath" in vscode's settings.json is ignored #3442
Comments
As an aside, I think the README.md section on configuration is a bit confusing:
Edit: The README.md is apparently outdated as there's a section that v10.0.0 will provide Prettier 3.0.0 when it's out of preview. The current extension is v10.40.0 and Prettier is at v3.3, but the extension is bundling 2.8.8. Happy to move this to a new issue if requested. |
After installing Prettier rather than using the built-in, the extension now acknowledges and uses the configuration file defined in Unfortunately I'll have to wait for an update to use the experimental ternaries option in VS Code settings, it seems |
Summary
VSCode/Prettier ignores the setting
"prettier.configPath"
.I prefer to have a global config for personal projects than copy/pasting config files to each. In my
settings.json
, I have tried:"prettier.configPath": "/home/kjkent/.config/prettier/prettierrc"
"prettier.configPath": "${userHome}/.config/prettier/prettierrc"
"prettier.configPath": "${env:XDG_CONFIG_HOME}/prettier/prettierrc"
I have also tried
.prettierrc
in case Prettier enforces its config be a dotfile, no change. If it's relevant, if I ask Prettier to format its own rc file, it does so and recognises the existence of the config due to being in the same folder, but, infers it to be a YAML file rather than a JSON file. Logs below.Github Repository to Reproduce Issue
N/A
Steps To Reproduce:
$HOME/.config/prettier/prettierrc
with the content in "Additional information", and set one of the above strings in VSCode's$HOME/.config/Code/User/settings.json
Expected result
Prettier parses the config file and applies the formatting it specifies
Actual result
Prettier logs show no recognition of the config file, with Prettier falling back to defaults
Additional information
/home/kjkent/.config/prettier/.prettierrc
:/home/kjkent/.config/Code/User/settings.json:
VS Code Version:
Version: 1.90.1
Commit: 611f9bfce64f25108829dd295f54a6894e87339d
Date: 2024-06-11T21:02:43.666Z
Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.90.1 Chrome/122.0.6261.156 Electron/29.4.0 Safari/537.36
Prettier Extension Version:
v10.4.0
OS and version:
Arch Linux
Linux version 6.9.5-arch1-1 (linux@archlinux) (gcc (GCC) 14.1.1 20240522, GNU ld (GNU Binutils) 2.42.0) #1 SMP PREEMPT_DYNAMIC Sun, 16 Jun 2024 19:06:37 +0000
Prettier Log Output
Log of formatting
/home/kjkent/.config/prettier/.prettierrc
:The text was updated successfully, but these errors were encountered: