From 85d43bcef3403a38c509d04606f2cd8ca91c8bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 15 Nov 2024 23:37:56 +0100 Subject: [PATCH] theme: add Prettier config #947 --- .editorconfig | 32 +++++++++++++------------------- .gitignore | 14 +++++++------- .prettierignore | 21 +++++++++++++++++++++ .prettierrc.json | 9 +++++++++ .vscode/settings.json | 32 ++++++++++++++++++++++++-------- layouts/partials/version.txt | 2 +- 6 files changed, 75 insertions(+), 35 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.json diff --git a/.editorconfig b/.editorconfig index 7849b090d7..e6baea38ed 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,19 +1,13 @@ -# https://editorconfig.org - -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 2 -indent_style = space -trim_trailing_whitespace = true - -[*.css] -indent_size = 4 - -[*.js] -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false +# https://editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 06430e18ee..4b9b2f1620 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ -.DS_Store -.githooks/hooks.log -.hugo_build.lock -exampleSite/public* -exampleSite/hugo*.exe -**/*.xcf -**/*.zip +.DS_Store +.githooks/hooks.log +.hugo_build.lock +exampleSite/public* +hugo*.exe +*.xcf +*.zip diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..5a01890c9d --- /dev/null +++ b/.prettierignore @@ -0,0 +1,21 @@ +.vscode +assets/css/chroma*.css +assets/css/variables.css +assets/_relearn_searchindex.js +exampleSite/.frontmatter +exampleSite/content +exampleSite/layouts +exampleSite/static +exampleSite/frontmatter.json +layouts +static/css +static/fonts +static/js/d3 +static/js/lunr +static/js/mathjax +static/js/swagger-ui +static/js/auto-complete.js +static/js/*.min.js +*.md +*.yaml +*.yml diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000000..9807c33417 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,9 @@ +{ + "printWidth": 9999, + "proseWrap": "preserve", + "quoteProps": "preserve", + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": true +} diff --git a/.vscode/settings.json b/.vscode/settings.json index fd1ce9f13b..e38170c324 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,25 @@ -{ - "spellright.language": [ - "en" - ], - "spellright.documentTypes": [ - "latex", - "markdown" - ] +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[css]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[yaml]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "editor.formatOnSave": true, + "editor.tabSize": 2, + "prettier.useEditorConfig": true, + "spellright.documentTypes": [ + "latex", + "markdown" + ], + "spellright.language": [ + "en" + ] } \ No newline at end of file diff --git a/layouts/partials/version.txt b/layouts/partials/version.txt index 56a25dcae8..cc99fe08f2 100644 --- a/layouts/partials/version.txt +++ b/layouts/partials/version.txt @@ -1 +1 @@ -7.1.1+28fce6b04c414523280c53ee02f9f3a94d9d23da \ No newline at end of file +7.1.1+57defcfab75859c444feb8af753a2b764cb6f64c \ No newline at end of file