From e873a729c0ba07a4fbc44acf3e1203fc810b3634 Mon Sep 17 00:00:00 2001 From: Sebastian Castro Date: Wed, 19 Jun 2024 10:51:25 +0200 Subject: [PATCH] Adds VsCode extensions and settings recommendations --- .gitignore | 3 ++- .vscode/extensions.json | 8 ++++++++ .vscode/settings.example.json | 23 +++++++++++++++++++++++ README.md | 6 +++++- 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .vscode/extensions.json create mode 100755 .vscode/settings.example.json diff --git a/.gitignore b/.gitignore index 4c15420aa..6b061f530 100755 --- a/.gitignore +++ b/.gitignore @@ -116,7 +116,8 @@ tools/* *.iml # vscode IDE -.vscode +!.vscode +.vscode/settings.json # Docker .db diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..c6d2e9dbc --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "esbenp.prettier-vscode", + "mhutchie.git-graph", + "junstyle.php-cs-fixer", + "dbaeumer.vscode-eslint" + ] +} diff --git a/.vscode/settings.example.json b/.vscode/settings.example.json new file mode 100755 index 000000000..51f46e4ab --- /dev/null +++ b/.vscode/settings.example.json @@ -0,0 +1,23 @@ +{ + "php-cs-fixer.executablePath": "/var/www/html/vendor/bin/php-cs-fixer", + "php-cs-fixer.ignorePHPVersion": true, + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[php]": { + "editor.defaultFormatter": "junstyle.php-cs-fixer" + }, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "always" + }, + "[twig]": { + "editor.formatOnSave": false, + "editor.formatOnPaste": false + }, + "[javascript]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "[css]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + } +} diff --git a/README.md b/README.md index e62e9fe71..5a922adec 100755 --- a/README.md +++ b/README.md @@ -31,7 +31,9 @@ We recommand an installation through docker. ### Linters & Formatters -Please install relevant extension and enable auto formating on your editor. Or run `make lint` before commit +Please install relevant extension and enable auto formating on your editor. + +Alternatly you can run `make lint` | Language | Linter/Formatter | | --------------------------- | ------------------------------------------------------------ | @@ -40,6 +42,8 @@ Please install relevant extension and enable auto formating on your editor. Or r | Twig | no automatic linter. Couldn't find one which is good enough. | | CSS, Yaml, JSON, Markdown.. | `prettier` | +If you use VS Code, get yeswiki linting settings with `cp .vscode/settings.example.json .vscode/settings.json` + ## History YesWiki grew out of a French language version of [WakkaWiki](https://en.wikipedia.org/wiki/WakkaWiki) called [Wikini](http://wikini.net), and hence has strong French language support.