Types not checked on the lambda functions
PabloRomanH opened this issue · 6 comments
When I use this, the typescript types of the front end are checked, but the lambda functions are not being checked, it seems like the types are just being stripped away without checking.
let foo: number = 'abc' results in an error in App.tsx but not in hello.ts.
PR welcome!
Any idea about what could be going on? I have no idea about how netlify-lambda works.
feel free to dive into the code. its not a lot :)
well its true netlify-lambda uses babel to strip out types. the question is whether you want to insert tsc into the process. on one hand, you get typechecking. on the other hand, its slower.
Do I want go get type checking? Yes! Why else would I be using TypeScript?
I'll look into the options I have. If I just add tsc to the npm scripts I wouldn't get autoreload.
because vscode can run the language service for you so you get typechecking as you type. there is more than one way to get typechecking. not obvious that putting it in build step is better.
Every single compiler, transpiler, and CLI tool shows type errors and linting errors on the console output. Even this project does it for the frontend. I find it hard to argue that this is anything other than a limitation of the current state of the tools. I don't know how VS Code works, but with my editor I can only see type errors if I open the file and go to the section of the file where an error happens to be. I can't know if changing some code somewhere resulted in errors in other places. Having a centralized place where I can see all the problems with my project is obviously a good thing.