Skip to content

Commit c848313

Browse files
committed
added eslint with ts
1 parent 2a5f5e4 commit c848313

File tree

7 files changed

+762
-14
lines changed

7 files changed

+762
-14
lines changed

.eslintrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"env": {
3+
"es2021": true
4+
},
5+
"extends": ["plugin:jsdoc/recommended", "google"],
6+
"parser": "@typescript-eslint/parser",
7+
"parserOptions": {
8+
"ecmaVersion": 2022,
9+
"sourceType": "module"
10+
},
11+
"plugins": ["@typescript-eslint", "jsdoc"],
12+
"rules": {
13+
"require-jsdoc": 0,
14+
"valid-jsdoc": "off",
15+
"jsdoc/require-jsdoc": [
16+
"error",
17+
{
18+
"publicOnly": false,
19+
"require": {
20+
"FunctionExpression": true,
21+
"ArrowFunctionExpression": true,
22+
"FunctionDeclaration": true,
23+
"MethodDefinition": true
24+
}
25+
}
26+
]
27+
}
28+
}

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"singleQuote": true,
5+
"bracketSpacing": false
6+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

nodemon.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"ignore": [".git", "node_modules/", "dist/"],
3+
"watch": ["server/"],
4+
"execMap": {
5+
"ts": "npx ts-node --esm"
6+
},
7+
"env": {
8+
"NODE_ENV": "development"
9+
},
10+
"ext": "ts"
11+
}

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
"name": "z-home-media-server-api",
33
"version": "0.0.1",
44
"private": true,
5+
"type": "module",
56
"scripts": {
6-
"start": "nodemon server/server.ts"
7+
"build": "npx tsc",
8+
"start": "nodemon --config nodemon.json server/server.ts"
79
},
810
"dependencies": {
911
"bcrypt": "^5.0.1",
@@ -12,6 +14,7 @@
1214
"cors": "^2.8.5",
1315
"dotenv": "^16.0.1",
1416
"express": "^4.18.1",
17+
"express-fileupload": "^1.4.0",
1518
"express-session": "^1.17.3",
1619
"mongodb": "4.7",
1720
"redis": "^4.1.1"
@@ -21,10 +24,17 @@
2124
"@types/connect-redis": "^0.0.18",
2225
"@types/cookie-parser": "^1.4.3",
2326
"@types/cors": "^2.8.12",
27+
"@types/dotenv": "^8.2.0",
2428
"@types/express": "^4.17.13",
29+
"@types/express-fileupload": "^1.2.2",
2530
"@types/express-session": "^1.17.4",
2631
"@types/mongodb": "^4.0.7",
2732
"@types/node": "^18.0.1",
33+
"@typescript-eslint/eslint-plugin": "^5.30.6",
34+
"@typescript-eslint/parser": "^5.30.6",
35+
"eslint": "^8.20.0",
36+
"eslint-config-google": "^0.14.0",
37+
"eslint-plugin-jsdoc": "^39.3.3",
2838
"nodemon": "^2.0.16",
2939
"ts-node": "^10.8.1",
3040
"typescript": "^4.7.4"

tsconfig.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4-
"module": "CommonJS",
4+
"module": "ES2022",
55
"moduleResolution": "node",
66
"outDir": "./dist",
77
"esModuleInterop": true,
88
"forceConsistentCasingInFileNames": true,
99
"strict": true,
10-
"skipLibCheck": true
10+
"skipLibCheck": true,
11+
"allowJs": false,
12+
"noImplicitAny": true,
1113
},
14+
"include": [ "server/**/*" ],
1215
"exclude": ["node_modules", "**/node_modules/*"],
1316
}

0 commit comments

Comments
 (0)