Skip to content

Commit b110170

Browse files
committed
Enable the TypeScript compiler options noUnusedLocals and noUnusedParameters.
1 parent f346a69 commit b110170

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- Omit unused catch bindings in the function `processRequest`.
4343
- Corrected the JSDoc type `FileUploadCreateReadStreamOptions` in the module `processRequest.mjs`.
4444
- Added a new dev dependency [`async-listen`](https://npm.im/async-listen) to replace the test utility function `listen`.
45+
- Enabled the TypeScript compiler options `noUnusedLocals` and `noUnusedParameters` and used the prefix `_` for purposefully unused function parameters in tests.
4546

4647
## 16.0.2
4748

graphqlUploadExpress.test.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe(
6060
const server = createServer(
6161
express()
6262
.use(graphqlUploadExpress())
63-
.use((request, response, next) => {
63+
.use((request, _response, next) => {
6464
requestBody = request.body;
6565
next();
6666
}),
@@ -109,7 +109,7 @@ describe(
109109
},
110110
}),
111111
)
112-
.use((request, response, next) => {
112+
.use((request, _response, next) => {
113113
requestBody = request.body;
114114
next();
115115
}),
@@ -169,11 +169,11 @@ describe(
169169
.use(
170170
/**
171171
* @param {Error} error
172-
* @param {Request} request
172+
* @param {Request} _request
173173
* @param {Response} response
174174
* @param {NextFunction} next
175175
*/
176-
(error, request, response, next) => {
176+
(error, _request, response, next) => {
177177
expressError = error;
178178
responseStatusCode = response.statusCode;
179179

@@ -237,11 +237,11 @@ describe(
237237
.use(
238238
/**
239239
* @param {Error} error
240-
* @param {Request} request
240+
* @param {Request} _request
241241
* @param {Response} response
242242
* @param {NextFunction} next
243243
*/
244-
(error, request, response, next) => {
244+
(error, _request, response, next) => {
245245
expressError = error;
246246

247247
// Sending a response here prevents the default Express error

jsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"maxNodeModuleJsDepth": 10,
44
"module": "nodenext",
55
"noEmit": true,
6+
"noUnusedLocals": true,
7+
"noUnusedParameters": true,
68
"strict": true
79
},
810
"typeAcquisition": {

0 commit comments

Comments
 (0)