Skip to content

Instantly share code, notes, and snippets.

@doingweb
Last active February 6, 2023 00:45
Show Gist options
  • Save doingweb/09a56f52b292607f5c75f5f466aa7173 to your computer and use it in GitHub Desktop.
Save doingweb/09a56f52b292607f5c75f5f466aa7173 to your computer and use it in GitHub Desktop.
A barebones TypeScript Node.js project
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"prettier/prettier": "error"
}
}
{
"printWidth": 120,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
// Once everything's set up, this should auto-format on save, provided VS Code is configured properly:
// https://github.com/microsoft/vscode-eslint#:~:text=The%20setting%20below%20turns%20on%20Auto%20Fix
import {hostname} from 'node:os'
var a: Array<number> = [
1,
2,
3,
]
let b : string[]= [
'a long',
'long long',
'long long long',
'long long long long',
'long long long long long array to keep on separate lines'
]
console.log( `hola ${ hostname() }` , a , b )
{
"name": "typescript-project-template",
"version": "1.0.0",
"author": "Chris Antes",
"license": "MIT",
"description": "A barebones TS project",
"private": true,
"type": "module",
"scripts": {
"start": "ts-node-esm index.ts",
"lint": "eslint src"
},
"devDependencies": {
"@tsconfig/next-strictest": "^1.0.0",
"@types/node": "^18.11.9",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
}
}
{
"extends": "@tsconfig/next-strictest/tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"types": ["node"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment