Skip to content

Commit ab95424

Browse files
committed
remove trailing commas
1 parent 438b949 commit ab95424

10 files changed

+21
-22
lines changed

.prettierrc

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"trailingComma": "all",
3-
"printWidth": 100,
4-
"singleAttributePerLine": true
2+
"trailingComma": "none",
3+
"printWidth": 100
54
}

eslint.config.mjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ export default [
1111
"warn",
1212
{
1313
argsIgnorePattern: "^_", // Ignore unused arguments starting with an underscore
14-
varsIgnorePattern: "^_", // Ignore unused variables starting with an underscore
15-
},
14+
varsIgnorePattern: "^_" // Ignore unused variables starting with an underscore
15+
}
1616
],
17-
"@typescript-eslint/explicit-function-return-type": "off", // Disable explicit return type enforcement
18-
},
17+
"@typescript-eslint/explicit-function-return-type": "off" // Disable explicit return type enforcement
18+
}
1919
},
2020
pluginJs.configs.recommended,
21-
...tseslint.configs.recommended,
21+
...tseslint.configs.recommended
2222
];

src/auth/auth.controller.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class AuthController extends Controller {
2828
response.cookie(
2929
"Authentication",
3030
this.authService.createToken(createdUser.id),
31-
this.authService.createCookieOptions(),
31+
this.authService.createCookieOptions()
3232
);
3333

3434
response.status(201).json(createdUser);
@@ -45,7 +45,7 @@ export class AuthController extends Controller {
4545
response.cookie(
4646
"Authentication",
4747
this.authService.createToken(user.id),
48-
this.authService.createCookieOptions(),
48+
this.authService.createCookieOptions()
4949
);
5050

5151
response.json(user);

src/auth/auth.repository.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class AuthRepository {
66
public async createUser(payload: RegisterPayload) {
77
const result = await pool.query<User>(
88
"INSERT INTO users (username, email, password) VALUES ($1, $2, $3) RETURNING *",
9-
[payload.username, payload.email, payload.password],
9+
[payload.username, payload.email, payload.password]
1010
);
1111
return result.rows[0];
1212
}

src/auth/auth.service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class AuthService {
1919

2020
const user = await this.authRepository.createUser({
2121
...payload,
22-
password: await bcrypt.hash(payload.password, 10), // Hash password
22+
password: await bcrypt.hash(payload.password, 10) // Hash password
2323
});
2424
if (!user) {
2525
throw new BadRequestError("Failed to create user");
@@ -56,7 +56,7 @@ export class AuthService {
5656
maxAge: 5 * 60 * 60 * 1000, // 5 hours
5757
httpOnly: true,
5858
sameSite: "lax",
59-
secure: process.env.NODE_ENV === "production",
59+
secure: process.env.NODE_ENV === "production"
6060
};
6161
}
6262

src/auth/auth.validation.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ export const registerSchema = z.object({
44
body: z.object({
55
username: z.string().min(3),
66
email: z.string().email(),
7-
password: z.string().min(6),
8-
}),
7+
password: z.string().min(6)
8+
})
99
});
1010

1111
export type RegisterPayload = z.infer<typeof registerSchema>["body"];
1212

1313
export const loginSchema = z.object({
1414
body: z.object({
1515
email: z.string().email(),
16-
password: z.string().min(6),
17-
}),
16+
password: z.string().min(6)
17+
})
1818
});
1919

2020
export type LoginPayload = z.infer<typeof loginSchema>["body"];

src/config/database.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const pool = new Pool({
77
password: env.POSTGRES_PASSWORD,
88
database: env.POSTGRES_DB,
99
port: env.POSTGRES_PORT,
10-
idleTimeoutMillis: 30000,
10+
idleTimeoutMillis: 30000
1111
});
1212

1313
export default pool;

src/config/env.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ export const env = cleanEnv(process.env, {
1212

1313
PORT: port({ default: 5000 }),
1414

15-
JWT_SECRET: str(),
15+
JWT_SECRET: str()
1616
});

src/middleware/error.middleware.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ function errorMiddleware(
55
error: HttpError,
66
_request: Request,
77
response: Response,
8-
_next: NextFunction,
8+
_next: NextFunction
99
) {
1010
const status = error.status || 500;
1111
const message = error.message || "Something went wrong";
1212
response.status(status).json({
1313
status,
14-
message,
14+
message
1515
});
1616
}
1717

src/middleware/validation.middleware.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const validationMiddleware =
88
await schema.parseAsync({
99
body: req.body,
1010
query: req.query,
11-
params: req.params,
11+
params: req.params
1212
});
1313
return next();
1414
} catch (error) {

0 commit comments

Comments
 (0)