-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.json
249 lines (237 loc) · 7.35 KB
/
settings.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
// SPDX-License-Identifier: MIT
// Copyright 2024 Beslogic Inc.
// The source skeleton for this configuration can be found at
// https://github.com/BesLogic/shared-configs/blob/main/.vscode/settings.json
// Modifications to this file that are not project-specific should also be done upstream.
{
/*
* General
*/
"files.associations": {
"*.nswag": "json",
"*.json": "jsonc",
"package.json": "json"
},
"files.exclude": {
"*.zip": true,
"**/build": true,
"**/dist/**/*.min.js": true,
"**/dist/**/*.map": true,
"**/src/react-app-env.d.ts": true
},
"search.exclude": {
"package-lock.json": true,
"*.lock": true
},
"editor.rulers": [
80,
100
],
"[git-commit]": {
"editor.rulers": [
72
]
},
"editor.detectIndentation": false,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"editor.bracketPairColorization.enabled": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
// "source.*Imports": https://github.com/microsoft/TypeScript/pull/50931#issuecomment-1416288712
// Let dedicated imports tool deal with it
"source.organizeImports": "never",
"source.sortImports": "never",
// IDEM, but also it's annoying to remove imports because of commented code while testing
"source.removeUnusedImports": "never"
},
// NOTE: due to a bug in VSCode, we have to specify editor.defaultFormatter individually to ensure
// it overrides user settings. Please upvote: https://github.com/microsoft/vscode/issues/168411
/*
* Markdown
*/
"[markdown]": {
"files.trimTrailingWhitespace": false,
"editor.defaultFormatter": "dprint.dprint"
},
"[dockerfile]": {
"editor.defaultFormatter": "dprint.dprint"
},
/*
* JSON
*/
"[json]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[jsonc]": {
"editor.defaultFormatter": "dprint.dprint"
},
/*
* JS/TS
*/
"[javascript]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[typescript]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dprint.dprint"
},
"dprint.path": "node_modules/dprint/dprint",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"js/ts.implicitProjectConfig.checkJs": true,
"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single",
"javascript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifier": "non-relative",
"eslint.validate": [
// "html", // For Angular
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"eslint.codeActionsOnSave.rules": [
// Clearing imports, unused vars and comments because of commented code while testing is annoying
"!unused-imports/no-unused-imports",
"!sonarjs/unused-import",
"!autofix/no-debugger",
"!autofix/no-unused-vars",
"!@eslint-community/eslint-comments/no-unused-disable",
"*"
],
"eslint.rules.customizations": [
{
"rule": "*",
"severity": "downgrade"
}
],
"jest.autoRun": "off",
/*
* HTML
*/
// Specify the formatter in case other formatters are also installed (ie: Prettier)
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"html.format.wrapAttributes": "force-expand-multiline",
// To match markup_fmt with dprint
"html.format.indentInnerHtml": true,
"html.format.extraLiners": "",
/*
* CSS
*/
// TODO: Configure stylelint or dprint-prettier so I can recommend it
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"[scss]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"[postcss]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"[less]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"less.format.spaceAroundSelectorSeparator": true,
"css.format.spaceAroundSelectorSeparator": true,
"scss.format.spaceAroundSelectorSeparator": true,
/*
* Python
*/
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.tabSize": 4,
"editor.rulers": [
72, // PEP8-17 docstrings
// 79, // PEP8-17 default max
// 88, // Black/Ruff default
// 99, // PEP8-17 acceptable max
100 // Our hard rule
]
},
"mypy-type-checker.importStrategy": "fromEnvironment",
"python.terminal.activateEnvironment": true,
// python.analysis is Pylance (pyright) configurations
"python.analysis.fixAll": [
// Explicitly omiting "source.convertImportFormat", let Ruff handle it
// Explicitly omiting "source.unusedImports", can be annoying when commenting code for debugging
],
"python.analysis.diagnosticMode": "workspace",
"ruff.importStrategy": "fromEnvironment",
// Use the Ruff extension instead
"isort.check": false,
// "python.analysis.importFormat": "relative", // If not using src-based layout
// For frontend-backend monorepos
// "mypy-type-checker.args": [
// // https://github.com/microsoft/vscode-mypy/issues/37#issuecomment-1602702174
// "--config-file=${workspaceFolder}/backend_project/pyproject.toml"
// ],
/*
* TOML
*/
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"evenBetterToml.formatter.alignComments": false,
"evenBetterToml.formatter.alignEntries": false,
"evenBetterToml.formatter.allowedBlankLines": 1,
"evenBetterToml.formatter.arrayAutoCollapse": true,
"evenBetterToml.formatter.arrayAutoExpand": true,
"evenBetterToml.formatter.arrayTrailingComma": true,
"evenBetterToml.formatter.columnWidth": 80,
"evenBetterToml.formatter.compactArrays": true,
"evenBetterToml.formatter.compactEntries": false,
"evenBetterToml.formatter.compactInlineTables": false,
"evenBetterToml.formatter.indentEntries": false,
"evenBetterToml.formatter.indentTables": false,
"evenBetterToml.formatter.inlineTableExpand": false,
"evenBetterToml.formatter.reorderArrays": true,
"evenBetterToml.formatter.trailingNewline": true,
// We like keeping TOML keys in a certain non-alphabetical order that feels more natural
"evenBetterToml.formatter.reorderKeys": false,
/*
* YAML
*/
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"yaml.format.printWidth": 100,
/*
* XML
*/
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
},
"xml.codeLens.enabled": true,
"xml.format.maxLineWidth": 100,
/*
* Powershell
*/
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
"powershell.codeFormatting.autoCorrectAliases": true,
"powershell.codeFormatting.trimWhitespaceAroundPipe": true,
"powershell.codeFormatting.useConstantStrings": true,
"powershell.codeFormatting.useCorrectCasing": true,
"powershell.codeFormatting.whitespaceBetweenParameters": true,
// Fixes a "unexpectedly closed" warning popup everytime this console is closed
"powershell.integratedConsole.startInBackground": true,
// Only start when openning a ps1 file
"powershell.integratedConsole.showOnStartup": false,
}