Skip to content

Commit 6a78353

Browse files
authored
Lib Upgrade April 25 (#15)
* upgrade express-server dependencies * upgrade nestjs-server dependencies * upgrade next-client dependencies * upgrade react-client * upgrade core-lib dependencies * update eslint config update eslint config * lint react client * lint nestjs-server * update pre-commit hook * lint express-server * lint next-client * update flat-config * upgrade flat-config
1 parent c893bb5 commit 6a78353

File tree

33 files changed

+525
-376
lines changed

33 files changed

+525
-376
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npx lint-staged
1+
npx lint-staged

apps/express-server/eslint.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import jsConfig from '@nish1896/eslint-flat-config/js';
2+
import tsConfig from '@nish1896/eslint-flat-config/ts';
23

34
export default [
45
...jsConfig,
6+
...tsConfig,
57
];

apps/express-server/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
"winston": "3.17.0"
1818
},
1919
"devDependencies": {
20-
"@nish1896/eslint-flat-config": "^1.1.4",
20+
"@nish1896/eslint-flat-config": "^2.0.2",
2121
"@types/cors": "^2.8.17",
22-
"@types/node": "^22.13.10",
23-
"eslint": "^9.22.0",
22+
"@types/node": "^22.13.14",
23+
"eslint": "^9.23.0",
2424
"nodemon": "^3.1.9",
2525
"rimraf": "^6.0.1",
26-
"tsc-alias": "^1.8.11",
26+
"tsc-alias": "^1.8.13",
2727
"tsconfig-paths": "^4.2.0",
2828
"typescript": "^5.8.2"
2929
}

apps/express-server/src/app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import express, { Express, Request, Response } from 'express';
1+
import express, {
2+
type Express,
3+
type Request,
4+
type Response
5+
} from 'express';
26
import cors from 'cors';
37
import { ENV_VARS } from '@/app-constants';
48
import { requestLogger } from '@/middleware';

apps/express-server/src/middleware/guard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response, NextFunction } from 'express';
1+
import type { Request, Response, NextFunction } from 'express';
22
import { winstonLogger } from './winston-logger';
33

44
export function validateAuthHeader(

apps/express-server/src/middleware/request-logger.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response, NextFunction } from 'express';
1+
import type { Request, Response, NextFunction } from 'express';
22
import { winstonLogger } from './winston-logger';
33

44
export function requestLogger(
@@ -22,7 +22,9 @@ export function printSuccessMsg(msg: string): void {
2222
}
2323

2424
export function printError(error: unknown): void {
25-
winstonLogger.error(`⚠ ERROR - ${error}`);
25+
winstonLogger.error(
26+
`⚠ ERROR - ${error instanceof Error ? error.message : JSON.stringify(error)}`
27+
);
2628
}
2729

2830
export function errorLogger(res: Response, error: unknown) {

apps/express-server/src/middleware/winston-logger.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable @typescript-eslint/restrict-template-expressions */
2+
13
import { createLogger, addColors, format, transports } from 'winston';
24
import { ENV_VARS } from '@/app-constants';
35

@@ -23,7 +25,7 @@ const customLevels = {
2325
}
2426
};
2527

26-
const myFormat = printf(
28+
const logFormat = printf(
2729
({ level, message, timestamp }) => `[ ${level} ]:: ${timestamp} - ${message}`
2830
);
2931

@@ -47,7 +49,7 @@ const winstonLogger = createLogger({
4749

4850
/* Aligns in a tabular format */
4951
// format.align(),
50-
myFormat
52+
logFormat
5153
),
5254
// defaultMeta: { service: 'log-service' },
5355
transports: [

apps/express-server/src/routes/auth/controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Router, Request, Response } from 'express';
1+
import { Router, type Request, type Response } from 'express';
22
import authService from './service';
3-
import * as AuthTypes from './types';
3+
import type * as AuthTypes from './types';
44

55
const authRouter = Router();
66

apps/express-server/src/routes/auth/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Response } from 'express';
1+
import type { Response } from 'express';
22

33
class AuthService {
44
loginUser(res: Response, email: string, password: string) {

apps/nestjs-server/eslint.config.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// @ts-check
21
import eslint from '@eslint/js';
32
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
43
import globals from 'globals';
54
import tseslint from 'typescript-eslint';
65
import jsConfig from '@nish1896/eslint-flat-config/js';
6+
import tsConfig from '@nish1896/eslint-flat-config/ts';
77

88
export default tseslint.config(
99
{
@@ -12,6 +12,7 @@ export default tseslint.config(
1212
eslint.configs.recommended,
1313
...tseslint.configs.recommendedTypeChecked,
1414
...jsConfig,
15+
...tsConfig,
1516
eslintPluginPrettierRecommended,
1617
{
1718
languageOptions: {
@@ -31,7 +32,8 @@ export default tseslint.config(
3132
rules: {
3233
'@typescript-eslint/no-explicit-any': 'off',
3334
'@typescript-eslint/no-floating-promises': 'warn',
34-
'@typescript-eslint/no-unsafe-argument': 'warn'
35+
'@typescript-eslint/no-unsafe-argument': 'warn',
36+
'@stylistic/plus/curly-newline': ['warn', { consistent: true }],
3537
},
3638
},
3739
);

0 commit comments

Comments
 (0)