Skip to content

Commit

Permalink
Boilerplate refinement and general clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksp committed Sep 20, 2022
1 parent 442eeb4 commit e3e5807
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 22 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules/
build/
coverage/
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ module.exports = {
node: true,
jest: true,
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
},
settings: {
'import/resolver': {
node: {
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run prettier-format && npm run lint
npm run pretty:fix && npm run lint && npm run test
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
20 changes: 5 additions & 15 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,12 @@
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript", "typescript"],
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
"editor.formatOnPaste": true,
"[markdown]": {
"editor.formatOnSave": false
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true,
"**/coverage": true
"editor.formatOnSave": false,
"editor.formatOnPaste": false,
},
"typescript.referencesCodeLens.enabled": true
"typescript.referencesCodeLens.enabled": true,
}
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cd <project_name>
npm install
```

- Build and run the project
- Generate production build and run the project

```bash
npm start
Expand All @@ -42,6 +42,26 @@ npm start
npm run dev
```

- Linting

```bash
npm run lint
npm run lint:fix
```

- Code formatting

```bash
npm run pretty
npm run pretty:fix
```

- Testing

```bash
npm test
```

## Sources

#### Official TypeScript-Node-Starter:
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"name": "typescript-node-starter",
"version": "1.0.0",
"description": "A minimal boilerplate for Node.js web applications written in TypeScript.",
"main": "index.js",
"main": "./build/index.js",
"scripts": {
"start": "npm run build && node build/index.js",
"build": "rimraf ./build && tsc",
"dev": "nodemon",
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write",
"lint": "eslint . --ext .ts",
"pretty": "prettier --config .prettierrc 'src/**/*.ts'",
"pretty:fix": "npm run pretty -- --write",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "npm run lint -- --fix",
"test": "jest",
"test:watch": "jest --watchAll",
Expand All @@ -19,7 +20,7 @@
"url": "git+https://github.com/nicksp/typescript-node-starter.git"
},
"keywords": [],
"author": "",
"author": "Nick Khan",
"license": "MIT",
"bugs": {
"url": "https://github.com/nicksp/typescript-node-starter/issues"
Expand Down
5 changes: 5 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* This is a typescript configuration file.
* See options https://www.typescriptlang.org/tsconfig
*/
{
"compilerOptions": {
"target": "es6",
Expand All @@ -11,6 +15,7 @@
"types": ["node", "jest"],
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"allowUnreachableCode": false,
"resolveJsonModule": true,
"noImplicitAny": true,
"sourceMap": true
Expand Down

0 comments on commit e3e5807

Please sign in to comment.