Monorepo - Multiple .vscode settings

Viewed 104

Project structure

I have the following project structure:

/
| - .vscode/
| - - - - settings.json
|
| - packages/
| - - - - app/
| - - - - - - index.js
| - - - - - - package.json
| - - - - website/
| - - - - - - .vscode/
| - - - - - - - - settings.json
| - - - - - - index.html
| - - - - - - styles.scss
| - - - - - - package.json
|
| - package.json
|

As you can notice, I have two vs-code setting files... one at the root and another one inside the website workspace.

Root vs-code settings

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
  },
  "editor.formatOnSave": false,
  "editor.tabSize": 2,
  "editor.rulers": [
    80,
    120
  ],
  "eslint.codeAction.showDocumentation": {
    "enable": true
  },
  "eslint.validate": [
    "javascript"
  ],
  "eslint.workingDirectories": [
    {
      "mode": "auto"
    }
  ],
  "javascript.updateImportsOnFileMove.enabled": "always",
}

Website workspace vs-code settings

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.fixAll.stylelint": true
  },
  "css.validate": false,
  "less.validate": false,
  "scss.validate": false,
  "stylelint.configFile": ".stylelintrc",
  "stylelint.snippet": [
    "css",
    "scss"
  ],
  "stylelint.validate": [
    "css",
    "scss"
  ],
  "stylelint.packageManager": "yarn"
}

Questions

I know that /.vscode/settings.json is merged with my vs-code default settings. But...

  1. Is /packages/website/.vscode/settings.json merged with /.vscode/settings.json

  2. As you can see, there is some code repetition in both configs:

  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
  },

and

  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.fixAll.stylelint": true
  },

If I remove "source.fixAll.eslint": true, from the /packages/website/.vscode/settings.json, will editor.codeActionsOnSave.source.fixAll.eslint be extended from /.vscode/settings.json?

0 Answers
Related