Skip to content

Commit

Permalink
Init default settings/extensions for VSCode (#569)
Browse files Browse the repository at this point in the history
* Init default settings/extensions for VSCode

* Add further settings

* Improve "format on save" options

Also do not use deprecated flags in new VSCode version.

* Remove trailing comma in settings.json

* Enable ESLint as formatter
  • Loading branch information
Splines authored Dec 19, 2023
1 parent b421193 commit 6f66405
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"shopify.ruby-lsp",
"dbaeumer.vscode-eslint",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-german"
]
}
85 changes: 85 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
//////////////////////////////////////
// JS (ESLint)
//////////////////////////////////////
// https://eslint.style/guide/faq#how-to-auto-format-on-save
// https://github.com/microsoft/vscode-eslint#settings-options
"[javascript]": {
"editor.formatOnSave": false, // to avoid formatting twice (ESLint + VSCode)
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.format.enable": true, // use ESLint as formatter
// this disables VSCode built-in formatter (instead we want to use ESLint)
"javascript.validate.enable": false,
//////////////////////////////////////
// HTML
//////////////////////////////////////
"[html]": {
"editor.formatOnSave": false // TODO: activate once HTML formatter installed
},
//////////////////////////////////////
// Ruby (Rubocop)
//////////////////////////////////////
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp",
"editor.formatOnSave": true
},
"rubyLsp.formatter": "rubocop",
"rubyLsp.rubyVersionManager": "rbenv",
"rubyLsp.enabledFeatures": {
"codeActions": true,
"diagnostics": true,
"documentHighlights": true,
"documentLink": true,
"documentSymbols": true,
"foldingRanges": true,
"formatting": true,
"hover": true,
"inlayHint": true,
"onTypeFormatting": true,
"selectionRanges": true,
"semanticHighlighting": true,
"completion": true,
"codeLens": true,
"definition": true
},
"rubyLsp.enableExperimentalFeatures": true,
//////////////////////////////////////
// Files
//////////////////////////////////////
"files.exclude": {
"node_modules/": true,
"pdfcomprezzor/": true,
"coverage/": true,
"solr/": true
},
"files.associations": {
"*.js.erb": "javascript",
"*.html.erb": "html"
},
//////////////////////////////////////
// Editor
//////////////////////////////////////
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 100, // toggle via Alt + Z shortcut
"editor.mouseWheelZoom": true,
"editor.rulers": [
{
"column": 80, // soft limit
"color": "#e5e5e5"
},
{
"column": 100, // hard limit
"color": "#c9c9c9"
}
],
//////////////////////////////////////
// Spell Checker
//////////////////////////////////////
"cSpell.words": [
"turbolinks"
]
}

0 comments on commit 6f66405

Please sign in to comment.