Skip to content

Commit 7c3fd98

Browse files
committed
fix linter warnings
1 parent daf0246 commit 7c3fd98

File tree

12 files changed

+26
-27
lines changed

12 files changed

+26
-27
lines changed

src/api/functions/authorization.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
DynamoDBClient,
3-
GetItemCommand,
4-
QueryCommand,
5-
} from "@aws-sdk/client-dynamodb";
1+
import { DynamoDBClient, GetItemCommand } from "@aws-sdk/client-dynamodb";
62
import { unmarshall } from "@aws-sdk/util-dynamodb";
73
import { genericConfig } from "../../common/config.js";
84
import { DatabaseFetchError } from "../../common/errors/index.js";

src/api/functions/entraId.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
officersGroupTestingId,
77
} from "../../common/config.js";
88
import {
9-
BaseError,
109
EntraFetchError,
1110
EntraGroupError,
1211
EntraInvitationError,
@@ -19,7 +18,6 @@ import {
1918
EntraGroupActions,
2019
EntraInvitationResponse,
2120
} from "../../common/types/iam.js";
22-
import { FastifyInstance } from "fastify";
2321
import { UserProfileDataBase } from "common/types/msGraphApi.js";
2422
import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
2523
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";

src/api/functions/membership.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FastifyBaseLogger, FastifyInstance } from "fastify";
1+
import { FastifyBaseLogger } from "fastify";
22

33
export async function checkPaidMembership(
44
endpoint: string,
@@ -11,7 +11,13 @@ export async function checkPaidMembership(
1111
log.trace(`Got Membership API Payload for ${netId}: ${membershipApiPayload}`);
1212
try {
1313
return membershipApiPayload["isPaidMember"];
14-
} catch (e: any) {
14+
} catch (e: unknown) {
15+
if (!(e instanceof Error)) {
16+
log.error(
17+
"Failed to get response from membership API (unknown error type.)",
18+
);
19+
throw e;
20+
}
1521
log.error(`Failed to get response from membership API: ${e.toString()}`);
1622
throw e;
1723
}

src/api/functions/mobileWallet.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ import { getSecretValue } from "../plugins/auth.js";
22
import {
33
ConfigType,
44
genericConfig,
5-
GenericConfigType,
65
SecretConfig,
76
} from "../../common/config.js";
87
import {
98
InternalServerError,
109
UnauthorizedError,
1110
} from "../../common/errors/index.js";
12-
import { FastifyInstance, FastifyRequest } from "fastify";
13-
// these make sure that esbuild includes the files
1411
import icon from "../resources/MembershipPass.pkpass/icon.png";
1512
import logo from "../resources/MembershipPass.pkpass/logo.png";
1613
import strip from "../resources/MembershipPass.pkpass/strip.png";

src/api/functions/stripe.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { FastifyBaseLogger } from "fastify";
21
import Stripe from "stripe";
32

43
export type StripeLinkCreateParams = {

src/api/plugins/auth.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from "../../common/errors/index.js";
1616
import { genericConfig, SecretConfig } from "../../common/config.js";
1717
import { getGroupRoles, getUserRoles } from "../functions/authorization.js";
18-
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
1918

2019
function intersection<T>(setA: Set<T>, setB: Set<T>): Set<T> {
2120
const _intersection = new Set<T>();

src/api/resources/types.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
2+
13
declare module "*.png" {
24
const value: string;
35
export default value;

src/api/routes/iam.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FastifyPluginAsync } from "fastify";
2-
import { allAppRoles, AppRoles } from "../../common/roles.js";
2+
import { AppRoles } from "../../common/roles.js";
33
import { zodToJsonSchema } from "zod-to-json-schema";
44
import {
55
addToTenant,
@@ -16,13 +16,9 @@ import {
1616
InternalServerError,
1717
NotFoundError,
1818
} from "../../common/errors/index.js";
19-
import {
20-
DynamoDBClient,
21-
GetItemCommand,
22-
PutItemCommand,
23-
} from "@aws-sdk/client-dynamodb";
19+
import { PutItemCommand } from "@aws-sdk/client-dynamodb";
2420
import { genericConfig } from "../../common/config.js";
25-
import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
21+
import { marshall } from "@aws-sdk/util-dynamodb";
2622
import {
2723
InviteUserPostRequest,
2824
invitePostRequestSchema,

src/api/routes/ics.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { FastifyPluginAsync } from "fastify";
22
import {
3-
DynamoDBClient,
43
QueryCommand,
54
QueryCommandInput,
65
ScanCommand,

src/api/routes/tickets.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { FastifyPluginAsync } from "fastify";
22
import { z } from "zod";
33
import {
4-
DynamoDBClient,
54
QueryCommand,
65
ScanCommand,
76
UpdateItemCommand,

0 commit comments

Comments
 (0)