You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was following the repo for the project I am working on with Typescript and express, but I have created my own project so obviously, I have my own tsconfig.json which has "noImplicitAny": true it helps to type checks by settings for any. I can easily set it to false which solves the problem in many places for e.g. app.use((err, req, res, next) => { res.status(err.status || 500); res.json({ errors: { message: err.message, }, });
Here err implicitly has an 'any' type that throws an error. I believe not to disable type checks by setting the error or any variables or functions to any as it completely gives up one of the greatest advantages of using Typescript - type-checking and enforcement.
The text was updated successfully, but these errors were encountered:
I was following the repo for the project I am working on with Typescript and express, but I have created my own project so obviously, I have my own tsconfig.json which has
"noImplicitAny": true
it helps to type checks by settings forany
. I can easily set it to false which solves the problem in many places for e.g.app.use((err, req, res, next) => { res.status(err.status || 500); res.json({ errors: { message: err.message, }, });
Here err implicitly has an 'any' type that throws an error. I believe not to disable type checks by setting the error or any variables or functions to any as it completely gives up one of the greatest advantages of using Typescript - type-checking and enforcement.
The text was updated successfully, but these errors were encountered: