Skip to content

Commit 3662f0a

Browse files
committed
fix: lint error
1 parent eb40628 commit 3662f0a

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

biome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"rules": {
1818
"recommended": true,
1919
"suspicious": {
20-
"noGlobalIsNan": "off"
20+
"noGlobalIsNan": "warn"
2121
},
2222
"correctness": {
23-
"noUnusedFunctionParameters": "off"
23+
"noUnusedFunctionParameters": "warn"
2424
}
2525
}
2626
},

src/controllers/banks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response, Router, RequestHandler } from "express";
1+
import { type Request, type Response, Router, type RequestHandler } from "express";
22
import {
33
commercialBanks,
44
mortgageFinanceInstitutions,

src/controllers/counties.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const counties_data = (req: Request, res: Response): void => {
1313
return;
1414
}
1515

16-
if (isNaN(county_code)) {
16+
if (Number.isNaN(county_code)) {
1717
const error_message = "Invalid County code";
1818
res.status(400).json(createErrorResponse(error_message));
1919
return;

src/controllers/country.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createSuccessResponse } from "../utilities/error";
44

55
const router = Router();
66

7-
const country_data = (req: Request, res: Response): void => {
7+
const country_data = (_req: Request, res: Response): void => {
88
res.status(200).json(createSuccessResponse(countryInfo));
99
};
1010

src/controllers/health_check.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export async function pingHealthEndpoint() {
4646
}
4747
}
4848
}
49-
const health_check = (req: Request, res: Response): void => {
49+
const health_check = (_req: Request, res: Response): void => {
5050
res.json({
5151
Status: "OK 👍",
5252
Name: "Kenya API",

src/controllers/postal_codes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const postal_data = (req: Request, res: Response): void => {
1313
return;
1414
}
1515

16-
if (!isNaN(postal_code)) {
16+
if (!Number.isNaN(postal_code)) {
1717
const found_post: PostalCode | undefined = postal_stations.find(
1818
(post) => post.code === postal_code
1919
);

src/controllers/towns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createSuccessResponse } from "../utilities/error";
44

55
const router = Router();
66

7-
const towns_data = (req: Request, res: Response): void => {
7+
const towns_data = (_req: Request, res: Response): void => {
88
res.status(200).json(createSuccessResponse(towns));
99
return;
1010
};

src/middlewares/loggingMiddleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { debug } from '../utilities/debug';
33

44
export function loggingMiddleware(
55
req: Request,
6-
res: Response,
6+
_res: Response,
77
next: NextFunction
88
) {
99
debug(`${req.method}: ${req.originalUrl}`);

tests/api_tests/banks.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,48 @@ describe('GET => /api/v1/banks', () => {
66
console.log('Server setup complete for banks tests');
77
});
88

9-
it('Should return 200 and all banks when no query is passed', async function () {
9+
it('Should return 200 and all banks when no query is passed', async () => {
1010
await supertest(app)
1111
.get('/api/v1/banks')
1212
.expect(200);
1313
});
1414

15-
it('Should return 200 and only commercial banks', async function () {
15+
it('Should return 200 and only commercial banks', async () => {
1616
await supertest(app)
1717
.get('/api/v1/banks')
1818
.query({ bank_type: 'commercial' })
1919
.expect(200);
2020
});
2121

22-
it('Should return 400 for invalid bank type', async function () {
22+
it('Should return 400 for invalid bank type', async () => {
2323
await supertest(app)
2424
.get('/api/v1/banks')
2525
.query({ bank_type: 'invalid-type' })
2626
.expect(400);
2727
});
2828

29-
it('Should filter by bank_name', async function () {
29+
it('Should filter by bank_name', async () => {
3030
await supertest(app)
3131
.get('/api/v1/banks')
3232
.query({ bank_name: 'equity' })
3333
.expect(200);
3434
});
3535

36-
it('Should filter by ussd only in commercial banks', async function () {
36+
it('Should filter by ussd only in commercial banks', async () => {
3737
await supertest(app)
3838
.get('/api/v1/banks')
3939
.query({ ussd: "*224#" })
4040
.expect(200);
4141
});
4242

43-
it('Should filter by paybill', async function () {
43+
it('Should filter by paybill', async () => {
4444
await supertest(app)
4545
.get('/api/v1/banks')
4646
.query({ paybill: '111777' })
4747
.expect(200);
4848
});
4949

50-
it('Should return 404 when no bank matches the query', async function () {
50+
it('Should return 404 when no bank matches the query', async () => {
5151
await supertest(app)
5252
.get('/api/v1/banks')
5353
.query({ bank_name: 'nonexistent-bank' })

0 commit comments

Comments
 (0)