-
-
Notifications
You must be signed in to change notification settings - Fork 448
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 "prettier.singleQuote" not working in 1.40 vs code #1099
Comments
I just "fixed" this by adding |
This is by design. VSCode settings are fallback in case no config is present. See: https://github.com/prettier/prettier-vscode#configuration |
@ntotten This is a bug. The fallback behavior is no longer working properly: i did not have |
I tried the workaround of adding |
@jpzwarte To be clear, it doesn't fall back per setting it only falls back if no config is found at all. If it fell back by setting that would result in some very weird behaviors for projects that specified the For this project, we are choosing #2 as it is the only practical option. The recommended best practice is to use a prettier configuration file for every project. Editor configs can also work, but they are more complicated as its not well documented by prettier and it doesnt actually support all of the configuration options of prettier. |
@balintbalazs That is because the settings in editorconfig are different than the prettier settings and there is no setting in |
@ntotten Thanks for the explanation. It is weird though that prettier just stopped working all of a sudden. That makes me think that something in the behavior you describe may have changed recently. 🧐 |
@ntotten Thanks for the insight. The Angluar CLI by default adds an .editorconfig file which doesn't specify the quotes. This basically breaks the fallback to the vscode configuration which caused some confusion. Adding |
@jpzwarte The behavior did change. In the <2 version of this extension LOTs of different config was merged together. That caused all sorts of weird issues and tons of bugs were opened because of it. We don't do that anymore, but rather rely on the We also had a bug in one of the 3.x releases where I accidentally merged config. I fixed that after I think something like 10 hours. |
Fixed by adding |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Prettier "prettier.singleQuote" not working in 1.40 vs code
Github Repository to Reproduce Issue
Steps To Reproduce:
"prettier.singleQuote": true,
"editor.formatOnSave": true,
Expected result:
File should format with "singleQuotes"
Actual result
File is formatted with double quotes
Additional information
VS Code Version:
Version: 1.40.1 (user setup)
Commit: 8795a9889db74563ddd43eb0a897a2384129a619
Date: 2019-11-13T16:49:35.976Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 6.1.7601
OS and version:
Windows 7 Enterprise
Version 6.1(Build 7601: Service Pack 1)
Prettier Log Output
[INFO - 10:09:39 AM] Extension Name: "prettier-vscode".
[INFO - 10:09:39 AM] Extension Version: "3.9.0".
[INFO - 10:09:39 AM] Enabling prettier for languages:
[
"javascript",
"mongo",
"javascriptreact",
"typescript",
"typescriptreact",
"json",
"jsonc",
"json5",
"css",
"postcss",
"less",
"scss",
"graphql",
"markdown",
"mdx",
"html",
"vue",
"yaml"
]
[INFO - 10:09:40 AM] Enabling prettier for range supported languages:
[
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"json",
"graphql"
]
[INFO - 10:10:17 AM] Formatting d:\AzureDevOps\Dev\Dev1.0\Web\src\app\widgets\common\element-browser\element-browser.service.ts.
[INFO - 10:10:17 AM] Using bundled version of prettier.
[INFO - 10:10:17 AM] Resolved ignore file to d:\AzureDevOps\Dev\Dev1.0\Web.prettierignore.
[INFO - 10:10:17 AM] File Info:
{
"ignored": false,
"inferredParser": "typescript"
}
[INFO - 10:10:18 AM] Prettier Options:
{
"filepath": "d:\AzureDevOps\Dev\Dev1.0\Web\src\app\widgets\common\element-browser\element-browser.service.ts",
"parser": "typescript",
"useTabs": false,
"tabWidth": 2
}
[INFO - 10:10:18 AM] Formatting completed in 561.919748ms.
[INFO - 10:10:26 AM] Formatting d:\AzureDevOps\Dev\Dev1.0\Web\src\app\widgets\common\element-browser\element-browser.service.ts.
[INFO - 10:10:26 AM] Using bundled version of prettier.
[INFO - 10:10:26 AM] Resolved ignore file to d:\AzureDevOps\Dev\Dev1.0\Web.prettierignore.
[INFO - 10:10:26 AM] File Info:
{
"ignored": false,
"inferredParser": "typescript"
}
[INFO - 10:10:26 AM] Prettier Options:
{
"filepath": "d:\AzureDevOps\Dev\Dev1.0\Web\src\app\widgets\common\element-browser\element-browser.service.ts",
"parser": "typescript",
"useTabs": false,
"tabWidth": 2
}
[INFO - 10:10:26 AM] Formatting completed in 42.85524ms.
The text was updated successfully, but these errors were encountered: