We have a TypeScript project that I am trying to clean-up a bit.
I started turning on stricter type-checking. Today, I just enabled
noUnusedParameters
tsconfig.json
expressJS
error TS6133: 'req' is declared but never used.
import * as express from 'express';
const app = express();
app.get('/', (req, res) => {
res.sendStatus(200);
});
req
res
You can resolve this error by prefixing or replacing the unused parameters with an underscore. In this case, you could prefix req
as _req
:
app.get('/', (_req, res) => {
...
});
See this post for more details.