Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2018-12-13 19:39:59 +0300
committerPaul Slaughter <pslaughter@gitlab.com>2018-12-14 17:29:56 +0300
commitc3d71eb3c4c295970a15885333a3ef8ed6bc83ca (patch)
tree10957c5ae1c02a6c5083be4601f0de40069ee68d /doc/development/new_fe_guide
parente5348394440b1d431a395625c7d2af70cebbdf43 (diff)
Update prettier.md with VSCode Settings section
**Why?** This is a recurring issue that new team members keep running into.
Diffstat (limited to 'doc/development/new_fe_guide')
-rw-r--r--doc/development/new_fe_guide/style/prettier.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/development/new_fe_guide/style/prettier.md b/doc/development/new_fe_guide/style/prettier.md
index baaea67d38b..4495f38f262 100644
--- a/doc/development/new_fe_guide/style/prettier.md
+++ b/doc/development/new_fe_guide/style/prettier.md
@@ -57,3 +57,38 @@ node ./scripts/frontend/prettier.js save-all ./vendor/
```
This will go over all files in a specific folder and save it.
+
+## VSCode Settings
+
+### Format on Save
+
+To automatically format your files with Prettier, add the following properties to your User or Workspace Settings:
+
+```javascript
+{
+ "[javascript]": {
+ "editor.formatOnSave": true
+ },
+ "[vue]": {
+ "editor.formatOnSave": true
+ },
+}
+```
+
+### Conflicts with Vetur Extension
+
+There are some [runtime issues](https://github.com/vuejs/vetur/issues/950) with [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and [the Vetur extension](https://marketplace.visualstudio.com/items?itemName=octref.vetur) for VSCode. To fix this, try adding the following properties to your User or Workspace Settings:
+
+```javascript
+{
+ "prettier.disableLanguages": [],
+ "vetur.format.defaultFormatter.html": "none",
+ "vetur.format.defaultFormatter.js": "none",
+ "vetur.format.defaultFormatter.css": "none",
+ "vetur.format.defaultFormatter.less": "none",
+ "vetur.format.defaultFormatter.postcss": "none",
+ "vetur.format.defaultFormatter.scss": "none",
+ "vetur.format.defaultFormatter.stylus": "none",
+ "vetur.format.defaultFormatter.ts": "none",
+}
+```