4 ms·
Like the author said, the weird thing is that it goes both ways. I'm pretty sure if you try to return `any` from a function with an explicit return type in Type
by ZephyrBlu 5y ago
Like the author said, the weird thing is that it goes both ways. I'm pretty sure if you try to return `any` from a function with an explicit return type in TypeScript you'll get pinged for it.
- derekbaker783 5y agoNot with any TSC settings I've ever used.
- MBCook 5y agonoImplicitAny is a very common config option that helps catch a ton of bugs. I wouldn’t use TS without it.
- mikewhy 5y agonoImplicitAny is different than what's being discussed (I think). Returning something typed as `any` in a function that has a different return type is totally fine: it's not implicit (you've cast it to any), and it passes (you're saying the type is literally anything after all). There are lint rules to avoid typing as `any`.
- DangitBobby 5y agoThere are "no explicit any" linting rules as well, which are a must.