From f359abad6be9b192b70079a1a50c67dc92b76375 Mon Sep 17 00:00:00 2001 From: FusiDaniel Date: Fri, 27 Oct 2023 00:34:00 -0300 Subject: [PATCH] fix: eslint --- apps/container/package.json | 3 ++- apps/container/src/bootstrap.ts | 1 + apps/react/package.json | 3 ++- package.json | 1 + packages/services/comments.ts | 25 ++++++------------------- packages/services/enrollments.ts | 32 +++++++++++++++----------------- packages/services/package.json | 3 ++- packages/services/reviews.ts | 4 ++-- packages/stores/package.json | 3 ++- turbo.json | 1 + 10 files changed, 34 insertions(+), 42 deletions(-) diff --git a/apps/container/package.json b/apps/container/package.json index 377a4528..bff44899 100644 --- a/apps/container/package.json +++ b/apps/container/package.json @@ -9,7 +9,8 @@ "build:staging": "vue-cli-service build --mode staging", "test": "vitest run --coverage", "test:watch": "vitest --coverage", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "lint:fix": "vue-cli-service lint --fix" }, "dependencies": { "@amcharts/amcharts5": "^5.4.1", diff --git a/apps/container/src/bootstrap.ts b/apps/container/src/bootstrap.ts index bf916d08..a585d19a 100644 --- a/apps/container/src/bootstrap.ts +++ b/apps/container/src/bootstrap.ts @@ -74,5 +74,6 @@ createApp(App) .use(VueQueryPlugin, { queryClient, }) + // eslint-disable-next-line @typescript-eslint/no-explicit-any .use(HighchartsVue as any) .mount('#app'); diff --git a/apps/react/package.json b/apps/react/package.json index db7edfaa..4628fa9c 100644 --- a/apps/react/package.json +++ b/apps/react/package.json @@ -5,7 +5,8 @@ "scripts": { "dev": "webpack serve --mode development", "build": "webpack --mode production", - "lint": "eslint ." + "lint": "eslint .", + "lint:fix": "eslint . --fix" }, "devDependencies": { "@babel/core": "^7.22.9", diff --git a/package.json b/package.json index 7fb228ab..8222dfd2 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "build": "turbo run build", "dev": "turbo run dev", "lint": "turbo run lint", + "lint:fix": "turbo run lint:fix", "test": "turbo run test" }, "devDependencies": { diff --git a/packages/services/comments.ts b/packages/services/comments.ts index 3e228bb5..f7eac898 100644 --- a/packages/services/comments.ts +++ b/packages/services/comments.ts @@ -1,5 +1,5 @@ - import { Comment } from 'types'; + import api from './api'; type GetCommentResponse = { @@ -8,36 +8,23 @@ type GetCommentResponse = { }; type CreateCommentRequest = { - comment: string, - enrollment: string, - type: string -}; - -type CommentResponse = { - _id: string; comment: string; - createdAt: string; - enrollment: { _id: string; }; - subject: string; - teacher: string; - updatedAt: string; -} - -type CreateCommentResponse = CommentResponse + enrollment: string; + type: string; +}; type UpdateCommentRequest = { id: string; comment: string; }; -type UpdateCommentResponse = CommentResponse - export const Comments = { get: (teacherId: string, subjectId: string, pageParam = 0) => api.get(`/comments/${teacherId}/${subjectId}`, { params: { page: pageParam, limit: 10 }, }), - getUserComment: (enrollmentId: string) => api.get(`/comments/enrollment/${enrollmentId}`), + getUserComment: (enrollmentId: string) => + api.get(`/comments/enrollment/${enrollmentId}`), create: (data: CreateCommentRequest) => api.post('/comments/', data), update: ({ id, comment }: UpdateCommentRequest) => api.put('/comments/' + id, { comment }), diff --git a/packages/services/enrollments.ts b/packages/services/enrollments.ts index ee5e766a..6af3b144 100644 --- a/packages/services/enrollments.ts +++ b/packages/services/enrollments.ts @@ -3,19 +3,19 @@ import { Concept } from 'types'; import api from './api'; type EnrollmentTeacherComment = { - _id: string, - comment: string, - viewers: number, - enrollment: string, - type: string, - ra: string, - active: boolean, - teacher: string, - subject: string, - updatedAt: string, - createdAt: string, - __v: number -} + _id: string; + comment: string; + viewers: number; + enrollment: string; + type: string; + ra: string; + active: boolean; + teacher: string; + subject: string; + updatedAt: string; + createdAt: string; + __v: number; +}; type EnrollmentTeacher = { _id: string; @@ -23,7 +23,7 @@ type EnrollmentTeacher = { updatedAt: string; createdAt: string; __v: number; - comment?: EnrollmentTeacherComment + comment?: EnrollmentTeacherComment; }; export type Subject = { @@ -47,12 +47,10 @@ export type Enrollment = { quad: number; subject: Subject; year: number; - comments?: string[] + comments?: string[]; }; export const Enrollments = { list: () => api.get('/enrollments'), get: (id: string) => api.get('/enrollments/' + id), }; - - diff --git a/packages/services/package.json b/packages/services/package.json index 5c825ad0..aa89baac 100644 --- a/packages/services/package.json +++ b/packages/services/package.json @@ -4,7 +4,8 @@ "main": "./index.ts", "license": "MIT", "scripts": { - "lint": "eslint \"**/*.ts\"" + "lint": "eslint \"**/*.ts\"", + "lint:fix": "eslint \"**/*.ts\" --fix" }, "devDependencies": { "eslint-config-custom": "*", diff --git a/packages/services/reviews.ts b/packages/services/reviews.ts index 057de685..48d8834d 100644 --- a/packages/services/reviews.ts +++ b/packages/services/reviews.ts @@ -1,8 +1,8 @@ import { + SearchSubjectItem, + SearchTeacherItem, SubjectInfo, TeacherReview, - SearchTeacherItem, - SearchSubjectItem, } from 'types'; import api from './api'; diff --git a/packages/stores/package.json b/packages/stores/package.json index e35535e0..40bed3ed 100644 --- a/packages/stores/package.json +++ b/packages/stores/package.json @@ -4,7 +4,8 @@ "main": "./index.ts", "license": "MIT", "scripts": { - "lint": "eslint \"**/*.ts\"" + "lint": "eslint \"**/*.ts\"", + "lint:fix": "eslint \"**/*.ts\" --fix" }, "devDependencies": { "eslint-config-custom": "*", diff --git a/turbo.json b/turbo.json index c190f11d..7b43e920 100644 --- a/turbo.json +++ b/turbo.json @@ -14,6 +14,7 @@ "outputs": ["dist/**"] }, "lint": {}, + "lint:fix": {}, "test": {}, "test:watch": { "cache": false