Skip to content

Commit 5278d13

Browse files
committed
yarn formatting fixes
1 parent 436aa3e commit 5278d13

File tree

11 files changed

+352
-312
lines changed

11 files changed

+352
-312
lines changed

backend/typescript/.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
createDefaultProgram: true,
99
tsconfigRootDir: __dirname,
1010
},
11+
plugins: ["@typescript-eslint", "import"], // Add this line
1112
extends: [
1213
"airbnb-typescript/base",
1314
"prettier",
@@ -19,5 +20,5 @@ module.exports = {
1920
"prettier/prettier": ["error", { endOfLine: "auto" }],
2021
"no-plusplus": 0,
2122
},
22-
ignorePatterns: ["build/*"],
23+
ignorePatterns: ["build/*", ".eslintrc.js"],
2324
};

backend/typescript/graphql/resolvers/teamMemberResolvers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const teamMemberResolvers = {
99
Query: {
1010
teamMembers: async (): Promise<TeamMemberDTO[]> => {
1111
try {
12-
return teamMemberService.getTeamMembers();
12+
return await teamMemberService.getTeamMembers();
1313
} catch (error) {
1414
throw new Error(getErrorMessage(error));
1515
}

backend/typescript/middlewares/auth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const isAuthorizedByRole = (roles: Set<Role>) => {
5454
/* Determine if request for a user-specific resource is authorized based on accessToken
5555
* validity and if the userId that the token was issued to matches the requested userId
5656
* Note: userIdField is the name of the request parameter containing the requested userId */
57-
export const isAuthorizedByUserId = (userIdField: string) => {
57+
export const isAuthorizedByUserId = () => {
5858
return async (
5959
resolve: (
6060
parent: any,
@@ -67,8 +67,8 @@ export const isAuthorizedByUserId = (userIdField: string) => {
6767
context: ExpressContext,
6868
info: GraphQLResolveInfo,
6969
) => {
70-
const accessToken = getAccessToken(context.req);
71-
const authorized = accessToken && (await true);
70+
// const accessToken = getAccessToken(context.req);
71+
// const authorized = accessToken && (await true);
7272

7373
// if (!authorized) {
7474
// throw new AuthenticationError(
@@ -83,7 +83,7 @@ export const isAuthorizedByUserId = (userIdField: string) => {
8383
/* Determine if request for a user-specific resource is authorized based on accessToken
8484
* validity and if the email that the token was issued to matches the requested email
8585
* Note: emailField is the name of the request parameter containing the requested email */
86-
export const isAuthorizedByEmail = (emailField: string) => {
86+
export const isAuthorizedByEmail = () => {
8787
return async (
8888
resolve: (
8989
parent: any,

backend/typescript/migrations/2025.07.21T15.30.15.create-applicant-record.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
DesignPositionTitles,
1212
ProductPositionTitles,
1313
CommunityPositionTitles,
14+
PositionTitle,
1415
} from "../types";
1516

1617
const ALL_POSITION_TITLES = [
@@ -28,7 +29,8 @@ function normalizeApplicantRole(role: string): string {
2829
if (trimmed.toLowerCase() === "project developer") return "Developer";
2930
// Capitalize each word for comparison
3031
const formatted = trimmed.replace(/\b\w/g, (c) => c.toUpperCase());
31-
if (ALL_POSITION_TITLES.includes(formatted as any)) return formatted;
32+
if (ALL_POSITION_TITLES.includes(formatted as PositionTitle))
33+
return formatted;
3234
return "President";
3335
}
3436

backend/typescript/migrations/20250927174454-create-team-member-table.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const up: Migration = async ({ context: sequelize }) => {
2020
allowNull: false,
2121
},
2222
teamRole: {
23-
type: DataTypes.ENUM("PM", "DESIGNER", "PL", "DEVELOPER"),
23+
type: DataTypes.ENUM("PM", "DESIGNER", "PL", "DEVELOPER"),
2424
allowNull: false,
2525
},
2626
createdAt: {
@@ -38,7 +38,7 @@ export const up: Migration = async ({ context: sequelize }) => {
3838

3939
export const down: Migration = async ({ context: sequelize }) => {
4040
await sequelize.getQueryInterface().dropTable(TABLE_NAME);
41-
await sequelize.getQueryInterface().sequelize.query(
42-
'DROP TYPE IF EXISTS "enum_team_members_teamRole";'
43-
);
41+
await sequelize
42+
.getQueryInterface()
43+
.sequelize.query('DROP TYPE IF EXISTS "enum_team_members_teamRole";');
4444
};

backend/typescript/migrations/20250927180215-create-team-member-table.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const up: Migration = async ({ context: sequelize }) => {
2020
allowNull: false,
2121
},
2222
teamRole: {
23-
type: DataTypes.ENUM("PM", "DESIGNER", "PL", "DEVELOPER"),
23+
type: DataTypes.ENUM("PM", "DESIGNER", "PL", "DEVELOPER"),
2424
allowNull: false,
2525
},
2626
createdAt: {
@@ -38,7 +38,7 @@ export const up: Migration = async ({ context: sequelize }) => {
3838

3939
export const down: Migration = async ({ context: sequelize }) => {
4040
await sequelize.getQueryInterface().dropTable(TABLE_NAME);
41-
await sequelize.getQueryInterface().sequelize.query(
42-
'DROP TYPE IF EXISTS "enum_team_members_teamRole";'
43-
);
41+
await sequelize
42+
.getQueryInterface()
43+
.sequelize.query('DROP TYPE IF EXISTS "enum_team_members_teamRole";');
4444
};

backend/typescript/models/teamMember.model.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { TeamRole, teamRoleValues } from "../types";
55

66
@Table({ tableName: "team_members" })
77
export default class TeamMember extends Model {
8-
@Column({
8+
@Column({
99
type: DataType.UUID,
1010
defaultValue: DataType.UUIDV4,
11-
primaryKey: true
11+
primaryKey: true,
1212
})
1313
id!: string;
1414

@@ -18,9 +18,9 @@ export default class TeamMember extends Model {
1818
@Column({ type: DataType.STRING, allowNull: false })
1919
lastName!: string;
2020

21-
@Column({
21+
@Column({
2222
type: DataType.ENUM(...teamRoleValues),
23-
allowNull: false
23+
allowNull: false,
2424
})
2525
teamRole!: TeamRole;
2626
}

backend/typescript/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@
6161
"@types/pg": "^7.14.10",
6262
"@types/umzug": "^2.3.0",
6363
"@types/validator": "^13.1.3",
64-
"@typescript-eslint/eslint-plugin": "^4.4.1",
65-
"@typescript-eslint/parser": "^4.15.2",
66-
"eslint": "^7.20.0",
67-
"eslint-config-airbnb-typescript": "^12.3.1",
68-
"eslint-config-prettier": "^8.0.0",
64+
"@typescript-eslint/eslint-plugin": "^6.21.0",
65+
"@typescript-eslint/parser": "^6.21.0",
66+
"eslint": "^8.57.0",
67+
"eslint-config-airbnb-typescript": "^17.1.0",
68+
"eslint-config-prettier": "^9.1.0",
6969
"eslint-plugin-import": "^2.22.1",
70-
"eslint-plugin-prettier": "^3.3.1",
70+
"eslint-plugin-prettier": "^5.1.3",
7171
"jest": "^27.0.4",
7272
"mongodb-memory-server": "^6.9.6",
7373
"nodemon": "^2.0.7",

backend/typescript/services/interfaces/teamMemberService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ interface ITeamMemberService {
1717
createTeamMember(teamMember: CreateTeamMemberDTO): Promise<TeamMemberDTO>;
1818
}
1919

20-
export default ITeamMemberService;
20+
export default ITeamMemberService;

backend/typescript/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,13 @@ export type ReviewedApplicantRecordDTO = {
239239

240240
// export type TeamRole = "PM" | "DESIGNER" | "PL" | "DEVELOPER";
241241
export const teamRoleValues = ["PM", "DESIGNER", "PL", "DEVELOPER"] as const;
242-
export type TeamRole = typeof teamRoleValues[number];
242+
export type TeamRole = (typeof teamRoleValues)[number];
243243

244244
export type TeamMemberDTO = {
245245
id: string;
246246
firstName: string;
247247
lastName: string;
248248
teamRole: TeamRole;
249-
}
249+
};
250250

251-
export type CreateTeamMemberDTO = Omit<TeamMemberDTO, "id">;
251+
export type CreateTeamMemberDTO = Omit<TeamMemberDTO, "id">;

0 commit comments

Comments
 (0)