Skip to content

Commit

Permalink
Merge pull request #4230 from kobotoolbox/toolchain
Browse files Browse the repository at this point in the history
Toolchain: Better out-of-the-box experience in VS Code
  • Loading branch information
p2edwards committed Jan 27, 2023
2 parents d3425a6 + 8a42a2e commit 91f8771
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 323 deletions.
13 changes: 10 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
root = true

# only apply to frontend files
[*.{es6,js,jsx,ts,tsx,coffee,scss,css,html}]
# defaults
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

# 2 spaces - frontend files mostly
[*.{es6,js,jsx,ts,tsx,coffee,scss,css,html,hbs,json,md,yml}]
indent_size = 2

# 4 spaces - python and others
[{*.{py,sh,ini},Dockerfile}]
indent_size = 4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ env
cypress/cypress/videos/*
cypress/cypress/screenshots/*
public
.venv
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.15.0
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.15.0
48 changes: 48 additions & 0 deletions kpi.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"folders": [
{
"path": "."
}
],
"extensions": {
"recommendations": [
"editorconfig.editorconfig", // EditorConfig

// Linters and Formatters
"ms-python.black-formatter", // Black (also installs MS Pylance)*
"dbaeumer.vscode-eslint", // ESLint
"rvest.vs-code-prettier-eslint", // Prettier
"stylelint.vscode-stylelint", // Stylelint
"freewil.vscode-coffeelint2", // Coffeelint

// Status Bar Toggle for Format and AutoFix on Save
"tombonnike.vscode-status-bar-format-toggle", // Formatting Toggle

// Syntax Support
"almahdi.code-django", // Django templates
]
},
"settings": {
// Black
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},

// Prettier
"[typescript][typescriptreact][javascript][javascriptreact]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},

// Stylelint
"stylelint.validate": ["css", "scss"],
"css.validate": false,
"scss.validate": false,

// Formatting Toggle
"formattingToggle.affects": [
"editor.formatOnSave",
"editor.codeActionsOnSave.source.fixAll.eslint",
"editor.codeActionsOnSave.source.fixAll.stylelint",
],
},
}
Loading

0 comments on commit 91f8771

Please sign in to comment.