Skip to content

Instantly share code, notes, and snippets.

@casaper
Last active May 13, 2024 10:44
Show Gist options
  • Save casaper/d764a124f7bf601ced653881f806760f to your computer and use it in GitHub Desktop.
Save casaper/d764a124f7bf601ced653881f806760f to your computer and use it in GitHub Desktop.
Some project starter snippets and templates
# Editorconfig: https://EditorConfig.org
root = true
[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{py,rs}]
indent_size = 4
tab_width = 4
[{*.{md,markdown,yaml,yml},.{git,eslint,prettier,stylelint,docker}ignore,.env*}]
trim_trailing_whitespace = false
[{*.json,{yarn,Gemfile}.lock}]
insert_final_newline = false
trim_trailing_whitespace = false
##################################################
## START .gitignore https://bit.ly/gitignoretpl ##
##################################################
### MacOS ###
.DS_Store
# Icon must end with two \r
Icon
# Icon must end with two \r
._*
### Windows ###
Thumbs.db*
ehthumbs*.db
*.lnk
### Linux ###
*~
.directory
.Trash-*
### VSCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/*.code-snippets
.history/
*.vsix
### JetBrains ###
.idea/
### Vim ###
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
Session.vim
Sessionx.vim
.netrwhist
tags
[._]*.un~
### general ###
logs
*.log
/coverage/
*.lcov
/tmp/
### Node ###
yarn*.log*
npm*.log*
.pnpm*.log
node_modules/
.npm
.node_repl_history
.yarn-integrity
.*cache
dist
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
### Java ###
*.class
*.jar
### Ruby ###
/.bundle/
.byebug_history
.repl_history
/.yardoc/
/_yardoc/
## END .gitignore https://bit.ly/gitignoretpl ##
################################################
{{
"tabWidth": 2,
"useTabs": false,
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"printWidth": 100,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"plugins": ["prettier-plugin-sh", "prettier-plugin-sql"],
"overrides": [
{
"files": "*.ts",
"options": {
"parser": "typescript"
}
},
{
"files": "*.js",
"options": {
"parser": "babel"
}
},
{
"files": "*.scss",
"options": {
"singleQuote": true,
"parser": "scss"
}
},
{
"files": "*.css",
"options": {
"singleQuote": false,
"parser": "css"
}
},
{
"files": "*.sql",
"options": {
"language": "postgresql",
"keywordCase": "preserve",
"database": "postgresql",
"newlineBeforeSemicolon": false,
"indentStyle": "standard",
"linesBetweenQueries": 1
}
},
{
"files": "*.{md,markdown}",
"options": {
"parser": "markdown"
}
},
{
"files": "*.{prettierrc,graphqlconfig,json}",
"options": { "parser": "json" }
},
{
"files": "*.{yml,yaml}",
"options": {
"parser": "yaml"
}
},
{
"files": "*.{sh,bash,zsh}",
"options": {
"parser": "sh",
"indent": 2,
"functionNextLine": false,
"keepPadding": false,
"spaceRedirects": false,
"switchCaseIndent": true,
"binaryNextLine": true
}
}
]
}
# add my common TypeScript linting setup to a project
yarn add -D \
@tsconfig/node20 \
@types/eslint \
@types/eslint-config-prettier \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser \
eslint \
eslint-config-prettier \
eslint-config-standard-with-typescript \
eslint-import-resolver-typescript \
eslint-plugin-import \
eslint-plugin-jsdoc \
eslint-plugin-prettier \
eslint-plugin-simple-import-sort \
eslint-plugin-tsdoc \
prettier \
prettier-plugin-sh \
prettier-plugin-sql \
typescript \
ts-node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment