Skip to content

Commit d2b4109

Browse files
Tony QiuTony Qiu
authored andcommitted
lint
1 parent 9eb3e26 commit d2b4109

File tree

11 files changed

+13
-10
lines changed

11 files changed

+13
-10
lines changed

backend/typescript/migrate.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
2+
/* eslint-disable import/no-extraneous-dependencies */
23
const path = require("path");
34
require("dotenv").config({
45
path: path.join(__dirname, "..", "..", ".env"),

backend/typescript/migrations/20260127040547-create-simple-entities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const up: Migration = async ({ context: sequelize }) => {
2121
allowNull: false,
2222
},
2323
enum_field: {
24-
type: DataType.ENUM('A', 'B', 'C', 'D'),
24+
type: DataType.ENUM("A", "B", "C", "D"),
2525
allowNull: false,
2626
},
2727
string_array_field: {

backend/typescript/models/entity.model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ export default class Entity extends Model {
2222
@Column
2323
file_name!: string;
2424
}
25-

backend/typescript/models/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ const DATABASE_URL =
1111
export const sequelize = new Sequelize(DATABASE_URL, {
1212
models: [path.join(__dirname, "/*.model.ts")],
1313
});
14-

backend/typescript/models/simpleEntity.model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ export default class SimpleEntity extends Model {
1919
@Column
2020
bool_field!: boolean;
2121
}
22-

backend/typescript/rest/entityRoutes.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import fs from "fs";
33
import multer from "multer";
44
// import { isAuthorizedByRole } from "@/middlewares/auth";
55
import { entityRequestDtoValidator } from "@/middlewares/validators/entityValidators";
6-
import EntityService from "@/services/implementations/entityService";
6+
// import EntityService from "@/services/implementations/entityService";
77
// import FileStorageService from "@/services/implementations/fileStorageService";
88
// import { IFileStorageService } from "@/services/interfaces/IFileStorageService";
99
import {
@@ -18,14 +18,16 @@ const upload = multer({ dest: "uploads/" });
1818
const entityRouter: Router = Router();
1919
// entityRouter.use(isAuthorizedByRole(new Set(["User", "Admin"])));
2020

21+
// Used when FileStorageService is uncommented
22+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2123
const defaultBucket = process.env.FIREBASE_STORAGE_DEFAULT_BUCKET || "";
2224
// const fileStorageService: IFileStorageService = new FileStorageService(
2325
// defaultBucket,
2426
// );
2527
// const entityService: IEntityService = new EntityService(fileStorageService);
2628

2729
// Mock Service
28-
let memoryStore: any = {};
30+
let memoryStore: Record<string, unknown> = {};
2931
const entityService: IEntityService = {
3032
createEntity: async (entity) => {
3133
memoryStore = { id: "1", ...entity };
@@ -35,6 +37,7 @@ const entityService: IEntityService = {
3537
memoryStore = { id, ...entity };
3638
return memoryStore;
3739
},
40+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
3841
getEntity: async (id) => {
3942
return memoryStore;
4043
},
@@ -146,6 +149,7 @@ entityRouter.delete("/:id", async (req, res) => {
146149

147150
/* Get file associated with entity by fileUUID */
148151
entityRouter.get("/files/:fileUUID", async (req, res) => {
152+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
149153
const { fileUUID } = req.params;
150154
try {
151155
const fileURL = "http://fake-storage.com/dummy.txt";

backend/typescript/server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import cookieParser from "cookie-parser";
22
import cors from "cors";
33
import express from "express";
4+
// Used when Firebase auth is uncommented below
5+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
46
import * as firebaseAdmin from "firebase-admin";
57
import swaggerUi from "swagger-ui-express";
68
import YAML from "yamljs";

backend/typescript/services/implementations/entityService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,3 @@ class EntityService implements IEntityService {
187187
}
188188

189189
export default EntityService;
190-

backend/typescript/services/implementations/simpleEntityService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,3 @@ class SimpleEntityService implements ISimpleEntityService {
139139
}
140140

141141
export default SimpleEntityService;
142-

backend/typescript/services/interfaces/ISimpleEntityService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export interface ISimpleEntityService {
3838
* @returns the created SimpleEntity
3939
* @throws Error if creation fails
4040
*/
41-
createEntity(entity: SimpleEntityRequestDTO): Promise<SimpleEntityResponseDTO>;
41+
createEntity(
42+
entity: SimpleEntityRequestDTO,
43+
): Promise<SimpleEntityResponseDTO>;
4244

4345
/**
4446
* update the SimpleEntity with the given id with fields in the DTO, return updated SimpleEntity

0 commit comments

Comments
 (0)