Skip to content

Instantly share code, notes, and snippets.

@casaper
Last active September 14, 2023 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.json]
insert_final_newline = ignore
[*.md]
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",
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100,
"plugins": ["prettier-plugin-sh"],
"overrides": [
{
"files": "*.ts",
"options": {
"parser": "typescript"
}
},
{
"files": "*.js",
"options": {
"parser": "babel"
}
},
{
"files": "*.{yml,yaml}",
"options": {
"parser": "yaml"
}
},
{
"files": "*.{md,markdown}",
"options": {
"parser": "markdown"
}
},
{
"files": "*.{prettierrc,graphqlconfig,json}",
"options": { "parser": "json" }
},
{
"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-plugin-import \
eslint-plugin-jsdoc \
eslint-plugin-prettier \
eslint-plugin-simple-import-sort \
eslint-plugin-tsdoc \
prettier \
prettier-plugin-sh \
typescript
{
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"baseUrl": "."
},
"include": ["src/**/*"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment