Skip to content

Instantly share code, notes, and snippets.

@AlexZeitler
Last active August 30, 2021 11:33
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 AlexZeitler/dbd4c5648d18df321accfcaa9f1c3465 to your computer and use it in GitHub Desktop.
Save AlexZeitler/dbd4c5648d18df321accfcaa9f1c3465 to your computer and use it in GitHub Desktop.
TypeScript + Node + VS Code Project settings
root = false
[**/**.yml]
indent_style = space
indent_size = 2
insert_final_newline = true
[**/**.ts]
indent_style = space
indent_size = 2
insert_final_newline = true
[**/**.js]
indent_style = space
indent_size = 2
insert_final_newline = true
[**/**.html]
indent_style = space
indent_size = 2
insert_final_newline = true
[**/**.json]
indent_style = space
indent_size = 2
insert_final_newline = true
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
env: {
node: true,
mocha: true,
es6: true
},
plugins: ['@typescript-eslint', 'prettier'],
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
module.exports = {
printWidth: 80,
tabWidth: 2,
singleQuote: true,
quoteProps: 'as-needed',
trailingComma: 'none',
bracketSpacing: true,
semi: false,
useTabs: false,
jsxBracketSameLine: false,
proseWrap: 'never'
}
module.exports = { extends: ['@commitlint/config-conventional'] }
#!/usr/bin/env bash
npx husky-init && yarn
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"'
yarn add --dev typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-import eslint-plugin-prettier prettier eslint-watch @commitlint/cli @commitlint/config-conventional @types/node@10 nodemon mocha ts-mocha @types/mocha should
{
"watch": ["src"],
"ext": "ts",
"ignore": ["src/**/*.spec.ts"],
"exec": "yarn start"
}
{
"scripts": {
"build": "tsc",
"start": "yarn build && node src/server.js",
"test": "ts-mocha test/**/*.ts --exit",
"watch": "nodemon"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"commitlint": {
"extends": [
"@commitlint/config-angular"
]
}
}
{
"mochaExplorer.files": "test/**/*.ts",
"mochaExplorer.require": "ts-mocha",
"mochaExplorer.exit": true,
"mochaExplorer.timeout": 5000,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"esModuleInterop": true,
"moduleResolution": "node",
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"allowJs": false,
/* Allow javascript files to be compiled. */
"checkJs": false,
/* Report errors in .js files. */
"sourceMap": true,
/* Generates corresponding '.map' file. */
"strict": true,
/* Allow implicit any */
"noImplicitAny": false,
/* Raise error on expressions and declarations with an implied 'any' type. */
"strictFunctionTypes": true,
/* Enable strict checking of function types. */
"allowSyntheticDefaultImports": true,
/* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"typeRoots": ["node_modules/@types"]
},
"include": ["types","src/**/*.ts", "test"],
"exclude": ["node_modules",]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment