Skip to content

Commit 3e5d1e9

Browse files
author
Brandon Scott
committed
Copy over common assets from AndcultureCode home repo (.githooks, vscode settings)
1 parent 2c66bad commit 3e5d1e9

4 files changed

Lines changed: 81 additions & 1 deletion

File tree

.githooks/pre-commit

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
# See https://prettier.io/docs/en/precommit.html#option-6-bash-script for reference
3+
4+
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
5+
[ -z "$FILES" ] && exit 0
6+
7+
echo -e "\x1b[1;35m[.githooks/pre-commit]\x1b[0m Running Prettier on any modified files..."
8+
9+
# Prettify all selected files
10+
echo "$FILES" | xargs ./node_modules/.bin/prettier --write
11+
12+
# Add back the modified/prettified files to staging
13+
echo "$FILES" | xargs git add
14+
15+
exit 0

.vscode/extensions.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"esbenp.prettier-vscode",
5+
"k--kato.docomment",
6+
"ms-dotnettools.csharp",
7+
"ms-vscode.vscode-typescript-tslint-plugin",
8+
"msjsdiag.debugger-for-chrome",
9+
"shardulm94.trailing-spaces"
10+
]
11+
}

.vscode/settings.json

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
11
{
2-
"typescript.tsdk": "node_modules/typescript/lib/"
2+
"[csharp]": {
3+
"editor.defaultFormatter": "ms-dotnettools.csharp"
4+
},
5+
"[scss]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[typescript]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[typescriptreact]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"csharp.format.enable": true,
15+
"editor.defaultFormatter": "esbenp.prettier-vscode",
16+
"editor.formatOnSave": true,
17+
"editor.rulers": [100],
18+
"json.schemas": [
19+
{
20+
"fileMatch": ["cypress.json"],
21+
"url": "https://on.cypress.io/cypress.schema.json"
22+
}
23+
],
24+
"prettier.requireConfig": true,
25+
"trailing-spaces.trimOnSave": true,
26+
"typescript.preferences.quoteStyle": "double",
27+
"typescript.tsdk": "./frontend/node_modules/typescript/lib"
328
}

.vscode/typescript.code-snippets

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
3+
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
4+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
5+
// same ids are connected.
6+
// Example:
7+
// "Print to console": {
8+
// "prefix": "log",
9+
// "body": [
10+
// "console.log('$1');",
11+
// "$2"
12+
// ],
13+
// "description": "Log output to console"
14+
// }
15+
//
16+
// Snippets can be easily generated or modified using https://snippet-generator.app/
17+
18+
"Typescript Region": {
19+
"prefix": "ts-region",
20+
"body": [
21+
"// -----------------------------------------------------------------------------------------",
22+
"// #region $1",
23+
"// -----------------------------------------------------------------------------------------",
24+
"",
25+
"// #endregion $1"
26+
],
27+
"description": "Typescript region"
28+
}
29+
}

0 commit comments

Comments
 (0)