Skip to content

Commit 8dabef9

Browse files
committed
thjs-63: * fix shared workspace linter
1 parent f883416 commit 8dabef9

29 files changed

+63
-55
lines changed

shared/src/libs/exceptions/http-error/http-error.exception.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { type ValueOf } from '~/libs/types/types.js';
2+
23
import { ExceptionName } from '../../enums/enums.js';
34
import { HttpCode } from '../../packages/http/http.js';
45

@@ -10,9 +11,9 @@ type Constructor = {
1011
};
1112

1213
class HttpError extends Error {
13-
status: ValueOf<typeof HttpCode>;
14+
public status: ValueOf<typeof HttpCode>;
1415

15-
constructor({
16+
public constructor({
1617
status = HttpCode.INTERNAL_SERVER_ERROR,
1718
message = DEFAULT_MESSAGE
1819
}: Partial<Constructor> = {}) {

shared/src/libs/exceptions/invalid-credentials-error/invalid-credentials-error.exception.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ExceptionMessage, ExceptionName } from '../../enums/enums.js';
22

33
class InvalidCredentialsError extends Error {
4-
constructor(message: string = ExceptionMessage.INCORRECT_EMAIL) {
4+
public constructor(message: string = ExceptionMessage.INCORRECT_EMAIL) {
55
super(message);
66
this.name = ExceptionName.INVALID_CREDENTIALS;
77
}

shared/src/libs/helpers/any/any.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { dayjs } from '../dayjs/dayjs.js';
22

3-
const getDiff = (a, b) => dayjs(a).diff(b);
3+
const getDiff = (a: Date | string, b: Date | string): number => {
4+
return dayjs(a).diff(b);
5+
};
46

57
export { getDiff };
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { dayjs } from '../dayjs/dayjs.js';
22

3-
const getFromNowTime = date => dayjs(date).fromNow();
3+
const getFromNowTime = (date: Date): string => dayjs(date).fromNow();
44

55
export { getFromNowTime };
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export { CommentPayloadKey, CommentsApiPath } from './libs/enums/enums.js';
22
export {
3-
type CommentWithUserNestedRelations,
43
type Comment,
4+
type CommentWithUserNestedRelations,
55
type CreateCommentRequestDto,
66
type GetCommentByIdResponseDto
77
} from './libs/types/types.js';

shared/src/packages/comment/libs/types/comment-with-user-nested-relations.type.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { UserWithImageRelation } from '~/packages/user/user.js';
2-
import { Comment } from './comment.type.js';
1+
import { type UserWithImageRelation } from '~/packages/user/user.js';
2+
3+
import { type Comment } from './comment.type.js';
34

45
type CommentWithUserNestedRelations = Comment &
56
Record<'user', UserWithImageRelation>;

shared/src/packages/comment/libs/types/create-comment-request-dto.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Comment } from './comment.type.js';
1+
import { type Comment } from './comment.type.js';
22

33
type CreateCommentRequestDto = Pick<Comment, 'body' | 'postId'>;
44

shared/src/packages/comment/libs/types/get-comment-by-id-response-dto.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CommentWithUserNestedRelations } from './comment-with-user-nested-relations.type.js';
1+
import { type CommentWithUserNestedRelations } from './comment-with-user-nested-relations.type.js';
22

33
type GetCommentByIdResponseDto = CommentWithUserNestedRelations | null;
44

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { type CommentWithUserNestedRelations } from './comment-with-user-nested-relations.type.js';
21
export { type Comment } from './comment.type.js';
3-
export { type GetCommentByIdResponseDto } from './get-comment-by-id-response-dto.type.js';
2+
export { type CommentWithUserNestedRelations } from './comment-with-user-nested-relations.type.js';
43
export { type CreateCommentRequestDto } from './create-comment-request-dto.type.js';
4+
export { type GetCommentByIdResponseDto } from './get-comment-by-id-response-dto.type.js';

0 commit comments

Comments
 (0)