Skip to content

Commit

Permalink
Enable the TypeScript compiler options noUnusedLocals and `noUnused…
Browse files Browse the repository at this point in the history
…Parameters`.
  • Loading branch information
jaydenseric committed Oct 7, 2024
1 parent f346a69 commit b110170
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
- Omit unused catch bindings in the function `processRequest`.
- Corrected the JSDoc type `FileUploadCreateReadStreamOptions` in the module `processRequest.mjs`.
- Added a new dev dependency [`async-listen`](https://npm.im/async-listen) to replace the test utility function `listen`.
- Enabled the TypeScript compiler options `noUnusedLocals` and `noUnusedParameters` and used the prefix `_` for purposefully unused function parameters in tests.

## 16.0.2

Expand Down
12 changes: 6 additions & 6 deletions graphqlUploadExpress.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe(
const server = createServer(
express()
.use(graphqlUploadExpress())
.use((request, response, next) => {
.use((request, _response, next) => {
requestBody = request.body;
next();
}),
Expand Down Expand Up @@ -109,7 +109,7 @@ describe(
},
}),
)
.use((request, response, next) => {
.use((request, _response, next) => {
requestBody = request.body;
next();
}),
Expand Down Expand Up @@ -169,11 +169,11 @@ describe(
.use(
/**
* @param {Error} error
* @param {Request} request
* @param {Request} _request
* @param {Response} response
* @param {NextFunction} next
*/
(error, request, response, next) => {
(error, _request, response, next) => {
expressError = error;
responseStatusCode = response.statusCode;

Expand Down Expand Up @@ -237,11 +237,11 @@ describe(
.use(
/**
* @param {Error} error
* @param {Request} request
* @param {Request} _request
* @param {Response} response
* @param {NextFunction} next
*/
(error, request, response, next) => {
(error, _request, response, next) => {
expressError = error;

// Sending a response here prevents the default Express error
Expand Down
2 changes: 2 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"maxNodeModuleJsDepth": 10,
"module": "nodenext",
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true
},
"typeAcquisition": {
Expand Down

0 comments on commit b110170

Please sign in to comment.