Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with noImplicitAny #94

Open
sohebatprocodes opened this issue Dec 29, 2020 · 2 comments
Open

Issue with noImplicitAny #94

sohebatprocodes opened this issue Dec 29, 2020 · 2 comments

Comments

@sohebatprocodes
Copy link

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.

@santiq
Copy link
Owner

santiq commented Dec 29, 2020

Hi there
What do you think is the best way to solve this issue?

@sohebatprocodes
Copy link
Author

I am working on the repo for type check, will take some time though, hope you accept PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants