Skip to content

Commit e5f0c6f

Browse files
committed
Upgrade package and basic configuration
1 parent 8afe58c commit e5f0c6f

File tree

6 files changed

+2067
-2214
lines changed

6 files changed

+2067
-2214
lines changed

.eslintrc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
{
22
"root": true,
33
"parser": "@typescript-eslint/parser",
4-
"plugins": [
5-
"security",
6-
"@typescript-eslint"
7-
],
4+
"plugins": ["sonarjs", "simple-import-sort", "jsdoc"],
85
"parserOptions": {
9-
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
10-
"sourceType": "module" // Allows for the use of imports
6+
"ecmaVersion": "latest",
7+
"sourceType": "module"
118
},
129
"ignorePatterns": ["./node_modules/*"],
1310
"extends": [
1411
"eslint:recommended",
15-
"plugin:security/recommended",
1612
"plugin:@typescript-eslint/recommended",
17-
"plugin:@typescript-eslint/eslint-recommended"
13+
"plugin:sonarjs/recommended",
14+
"plugin:jsdoc/recommended-typescript"
1815
],
1916
"rules": {
2017
"no-error-on-unmatched-pattern": "off",
21-
"@typescript-eslint/no-explicit-any": "off", // TODO: Remove this.
22-
"no-return-await": "off",
23-
"no-shadow": "off",
24-
"@typescript-eslint/no-shadow": ["error"]
18+
"@typescript-eslint/no-explicit-any": "warn",
19+
"sonarjs/cognitive-complexity": "off",
20+
"@typescript-eslint/no-shadow": ["error"],
21+
"@typescript-eslint/ban-ts-comment": "off",
22+
"simple-import-sort/imports": "warn",
23+
"jsdoc/no-types": "off",
24+
"jsdoc/tag-lines": "off",
25+
"jsdoc/require-returns-description": "off"
2526
}
2627
}

SECURITY.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ services:
2424
- postgres
2525
ports:
2626
- "8000:8000"
27-
command: sh -c "yarn && yarn start"
27+
command: sh -c "yarn && yarn dev"

package.json

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-api-starter",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Starter for Node.js express API with Typescript",
55
"main": "index.js",
66
"repository": {
@@ -15,7 +15,7 @@
1515
"node": ">= 16.5.0"
1616
},
1717
"scripts": {
18-
"start": "concurrently 'npx tsc --watch' 'nodemon -q build/index.js'",
18+
"dev": "concurrently 'npx tsc --watch' 'nodemon -q build/index.js'",
1919
"transpile": "tsc",
2020
"clean": "rimraf build",
2121
"sync-env": "sync-dotenv",
@@ -52,52 +52,54 @@
5252
"typescript"
5353
],
5454
"dependencies": {
55-
"bcrypt": "^5.0.1",
55+
"bcrypt": "^5.1.1",
5656
"cors": "^2.8.5",
57-
"date-fns": "^2.11.1",
58-
"dotenv": "^16.0.1",
57+
"date-fns": "^3.6.0",
58+
"dotenv": "^16.4.5",
5959
"express": "4.19.2",
60-
"helmet": "^5.1.0",
61-
"http-status-codes": "^2.1.4",
62-
"joi": "^17.6.0",
63-
"jsonwebtoken": "^9.0.0",
64-
"knex": "^2.4.0",
65-
"morgan": "^1.10.0",
66-
"nodemailer": "^6.9.9",
60+
"helmet": "^7.1.0",
61+
"http-status-codes": "^2.3.0",
62+
"joi": "^17.12.2",
63+
"jsonwebtoken": "^9.0.2",
64+
"knex": "^3.1.0",
65+
"nodemailer": "^6.9.13",
6766
"nodemailer-markdown": "^1.0.3",
68-
"objection": "^3.0.1",
69-
"pg": "^8.6.0",
70-
"winston": "^3.3.3",
71-
"winston-daily-rotate-file": "^4.5.5"
67+
"objection": "^3.1.4",
68+
"pg": "^8.11.3",
69+
"winston": "^3.13.0",
70+
"winston-daily-rotate-file": "^5.0.0"
7271
},
7372
"devDependencies": {
74-
"@faker-js/faker": "^7.3.0",
75-
"@types/bcrypt": "^5.0.0",
76-
"@types/cors": "^2.8.12",
77-
"@types/express": "^4.17.13",
78-
"@types/jest": "^28.1.3",
79-
"@types/jsonwebtoken": "^8.5.4",
80-
"@types/morgan": "^1.9.3",
81-
"@types/node": "^18.0.0",
82-
"@types/nodemailer": "^6.4.4",
83-
"@types/supertest": "^2.0.11",
84-
"@typescript-eslint/eslint-plugin": "^5.30.0",
85-
"@typescript-eslint/parser": "^5.30.0",
86-
"chalk": "^4.1.1",
87-
"concurrently": "^7.2.2",
88-
"eslint": "^8.18.0",
89-
"eslint-plugin-security": "^1.4.0",
90-
"husky": "^8.0.1",
91-
"jest": "^28.1.2",
92-
"lint-staged": "^13.0.3",
93-
"nodemon": "^2.0.12",
94-
"prettier": "^2.3.2",
95-
"rimraf": "^3.0.2",
96-
"supertest": "^6.1.4",
97-
"sync-dotenv": "^2.6.2",
98-
"ts-jest": "^28.0.5",
99-
"ts-node": "^10.9.1",
100-
"tslib": "^2.4.0",
101-
"typescript": "^4.8.4"
73+
"@faker-js/faker": "^8.4.1",
74+
"@types/bcrypt": "^5.0.2",
75+
"@types/cors": "^2.8.17",
76+
"@types/express": "^4.17.21",
77+
"@types/jest": "^29.5.12",
78+
"@types/jsonwebtoken": "^9.0.6",
79+
"@types/node": "^20.11.30",
80+
"@types/nodemailer": "^6.4.14",
81+
"@types/supertest": "^6.0.2",
82+
"@typescript-eslint/eslint-plugin": "^7.4.0",
83+
"@typescript-eslint/parser": "^7.4.0",
84+
"chalk": "^5.3.0",
85+
"concurrently": "^8.2.2",
86+
"eslint": "^8.57.0",
87+
"eslint-plugin-jsdoc": "^48.2.2",
88+
"eslint-plugin-prettier": "^5.1.3",
89+
"eslint-plugin-security": "^2.1.1",
90+
"eslint-plugin-simple-import-sort": "^12.0.0",
91+
"eslint-plugin-sonarjs": "^0.25.0",
92+
"husky": "^9.0.11",
93+
"jest": "^29.7.0",
94+
"lint-staged": "^15.2.2",
95+
"nodemon": "^3.1.0",
96+
"prettier": "^3.2.5",
97+
"rimraf": "^5.0.5",
98+
"supertest": "^6.3.4",
99+
"sync-dotenv": "^2.7.0",
100+
"ts-jest": "^29.1.2",
101+
"ts-node": "^10.9.2",
102+
"tslib": "^2.6.2",
103+
"typescript": "^5.4.3"
102104
}
103105
}

tsconfig.json

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
4-
"sourceMap": true,
5-
"outDir": "./build",
6-
"declaration": true,
3+
"target": "ESNext",
74
"module": "commonjs",
8-
"importHelpers": true,
9-
"removeComments": true,
10-
"downlevelIteration": true,
11-
"lib": ["es2015", "es2016", "es2017"],
12-
5+
"lib": ["ESNext"],
6+
"outDir": "./build",
7+
"rootDir": "./src",
138
"strict": true,
14-
"alwaysStrict": true,
9+
"esModuleInterop": true,
10+
"resolveJsonModule": true,
11+
"allowSyntheticDefaultImports": true,
12+
"declaration": true,
13+
"sourceMap": true,
1514
"noImplicitAny": true,
1615
"noImplicitThis": true,
1716
"noUnusedLocals": true,
@@ -20,18 +19,10 @@
2019
"noUnusedParameters": true,
2120
"strictFunctionTypes": true,
2221
"noFallthroughCasesInSwitch": true,
23-
2422
"baseUrl": "./",
25-
"esModuleInterop": true,
26-
"preserveSymlinks": true,
27-
"resolveJsonModule": true,
28-
"moduleResolution": "node",
29-
"types": ["node", "express", "jest"],
30-
"allowSyntheticDefaultImports": true,
3123
"paths": {
3224
"*": ["src/types/*"]
3325
},
34-
3526
"emitDecoratorMetadata": true,
3627
"experimentalDecorators": true
3728
},

0 commit comments

Comments
 (0)