mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Set Prettier as default formatter in VS Code for JSON and YAML (#154484)
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
"GitHub.vscode-pull-request-github",
|
"GitHub.vscode-pull-request-github",
|
||||||
"GitHub.copilot"
|
"GitHub.copilot"
|
||||||
],
|
],
|
||||||
// Please keep this file in sync with settings in home-assistant/.vscode/settings.default.json
|
// Please keep this file in sync with settings in home-assistant/.vscode/settings.default.jsonc
|
||||||
"settings": {
|
"settings": {
|
||||||
"python.experiments.optOutFrom": ["pythonTestAdapter"],
|
"python.experiments.optOutFrom": ["pythonTestAdapter"],
|
||||||
"python.defaultInterpreterPath": "/home/vscode/.local/ha-venv/bin/python",
|
"python.defaultInterpreterPath": "/home/vscode/.local/ha-venv/bin/python",
|
||||||
@@ -63,6 +63,9 @@
|
|||||||
"[python]": {
|
"[python]": {
|
||||||
"editor.defaultFormatter": "charliermarsh.ruff"
|
"editor.defaultFormatter": "charliermarsh.ruff"
|
||||||
},
|
},
|
||||||
|
"[json][jsonc][yaml]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
"json.schemas": [
|
"json.schemas": [
|
||||||
{
|
{
|
||||||
"fileMatch": ["homeassistant/components/*/manifest.json"],
|
"fileMatch": ["homeassistant/components/*/manifest.json"],
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -111,6 +111,7 @@ virtualization/vagrant/config
|
|||||||
!.vscode/cSpell.json
|
!.vscode/cSpell.json
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
!.vscode/tasks.json
|
!.vscode/tasks.json
|
||||||
|
!.vscode/settings.default.jsonc
|
||||||
.env
|
.env
|
||||||
|
|
||||||
# Windows Explorer
|
# Windows Explorer
|
||||||
|
|||||||
@@ -9,13 +9,17 @@
|
|||||||
"pylint.importStrategy": "fromEnvironment",
|
"pylint.importStrategy": "fromEnvironment",
|
||||||
// Pyright is too pedantic for Home Assistant
|
// Pyright is too pedantic for Home Assistant
|
||||||
"python.analysis.typeCheckingMode": "basic",
|
"python.analysis.typeCheckingMode": "basic",
|
||||||
|
"[python]": {
|
||||||
|
"editor.defaultFormatter": "charliermarsh.ruff"
|
||||||
|
},
|
||||||
|
"[json][jsonc][yaml]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
"json.schemas": [
|
"json.schemas": [
|
||||||
{
|
{
|
||||||
"fileMatch": [
|
"fileMatch": ["homeassistant/components/*/manifest.json"],
|
||||||
"homeassistant/components/*/manifest.json"
|
// This value differs between working with devcontainer and locally, therefore this value should NOT be in sync!
|
||||||
],
|
"url": "./script/json_schemas/manifest_schema.json"
|
||||||
// This value differs between working with devcontainer and locally, therefor this value should NOT be in sync!
|
}
|
||||||
"url": "./script/json_schemas/manifest_schema.json"
|
]
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ cd "$(dirname "$0")/.."
|
|||||||
|
|
||||||
# Add default vscode settings if not existing
|
# Add default vscode settings if not existing
|
||||||
SETTINGS_FILE=./.vscode/settings.json
|
SETTINGS_FILE=./.vscode/settings.json
|
||||||
SETTINGS_TEMPLATE_FILE=./.vscode/settings.default.json
|
SETTINGS_TEMPLATE_FILE=./.vscode/settings.default.jsonc
|
||||||
if [ ! -f "$SETTINGS_FILE" ]; then
|
if [ ! -f "$SETTINGS_FILE" ]; then
|
||||||
echo "Copy $SETTINGS_TEMPLATE_FILE to $SETTINGS_FILE."
|
echo "Copy $SETTINGS_TEMPLATE_FILE to $SETTINGS_FILE."
|
||||||
cp "$SETTINGS_TEMPLATE_FILE" "$SETTINGS_FILE"
|
cp "$SETTINGS_TEMPLATE_FILE" "$SETTINGS_FILE"
|
||||||
|
|||||||
Reference in New Issue
Block a user