Skip to content

Commit 43116b0

Browse files
committed
lint fix
1 parent 91a5672 commit 43116b0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/middleware/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function expressGraphQLRateLimiter(
6969
req: Request,
7070
res: Response,
7171
next: NextFunction
72-
): Promise<void | Response<any, Record<string, any>>> => {
72+
): Promise<void | Response<unknown, Record<string, unknown>>> => {
7373
const requestTimestamp = new Date().valueOf();
7474
// access the query and variables passed to the server in the body or query string
7575
let query;
@@ -82,8 +82,9 @@ export default function expressGraphQLRateLimiter(
8282
variables = req.body.variables;
8383
}
8484
if (!query) {
85+
// eslint-disable-next-line no-console
8586
console.error(
86-
'Error in expressGraphQLRateLimiter: There is no query on the request. Rate-Limiting skipped'
87+
'[graphql-gate] Error in expressGraphQLRateLimiter: There is no query on the request. Rate-Limiting skipped'
8788
);
8889
return next();
8990
}
@@ -140,9 +141,9 @@ export default function expressGraphQLRateLimiter(
140141
}
141142
return next();
142143
} catch (err) {
143-
// log the error to the console and pass the request onto the next middleware.
144+
// eslint-disable-next-line no-console
144145
console.error(
145-
`Error in expressGraphQLRateLimiter processing query. Rate limiting is skipped: ${err}`
146+
`[graphql-gate] Error in expressGraphQLRateLimiter processing query. Rate limiting is skipped: ${err}`
146147
);
147148
return next(err);
148149
}

src/rateLimiters/slidingWindowLog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Redis from 'ioredis';
2-
import { RateLimiter, RateLimiterResponse, RedisBucket, RedisLog } from '../@types/rateLimit';
2+
import { RateLimiter, RateLimiterResponse, RedisLog } from '../@types/rateLimit';
33

44
/**
55
* The SlidingWindowLog instance of a RateLimiter limits requests based on a unique user ID.

0 commit comments

Comments
 (0)