From e2f54e29faba4f74a59971fd66d64b7c38e9eb0f Mon Sep 17 00:00:00 2001 From: Felipe Lalanne <1822826+pipex@users.noreply.github.com> Date: Wed, 24 Jan 2024 18:43:07 -0300 Subject: [PATCH] Add prettierrc for editor compatibility The tsserver lsp doesn't seem to work well with .editorconfig. Using prettierrc will allow formatting to work correctly with editor plugins This also updates editorconfig to work well with json Change-type: patch --- .editorconfig | 3 ++- .prettierrc.js | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .prettierrc.js diff --git a/.editorconfig b/.editorconfig index e5e75cdb..91112c8e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,5 +11,6 @@ insert_final_newline = true [*.md] trim_trailing_whitespace = false -[*.json] +[*.{json,yml}] indent_style = space +indent_size = 2 diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..28b22d53 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,5 @@ +const fs = require('fs'); + +module.exports = JSON.parse( + fs.readFileSync('./node_modules/@balena/lint/config/.prettierrc', 'utf8'), +);