-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support nullability check even when type is not specified #7
Comments
Thanks for using the library! I only used some TypeORM features, so I was not familiar that you can omit the type parameter. I changed the code that it falls back to the TypeScript types, it is in next release: v0.2.6. Can you try if this solves your problem? |
I had to fix a condition, I updated master with this change. I wait and if you don't find any more bugs I can put out a new release. 😄 |
Nice! I went over all our entities and I did find some more stuff:
|
Thanks for the list, you are 100% correct, I didn't have in mind that you can set types as strings. I fixed this so now you can use multiple parameters in a decorators as it usually works in TypeORM. Also you reminded me a feature I wanted to add, which is the odd behaviour that |
Great! I haven't built/used the code locally yet, will have to look into that. Planning to do so after the weekend! |
Sorry for the delay, I only got to testing it now. But good news, for items 1 & 2 and all variations on their cases I could think of, it all works as expected! Thank you 😊 |
Thanks for testing, if all's good in v0.3.0, you can close this issue. |
All is good, thanks again! Closing issue 👍 |
First off: this is a neat plugin, thanks for making it :) We have a ton of entities and we can really use this to save some headache. I encountered an issue/feature request that I would like raise which I think should make it more complete and intuitive to use. Here goes:
I have an Entity where I made the nullability wrong on purpose:
However, the plugin doesn't show an error. It took me a bit to figure out why. As it turns out, errors will only start showing once you specify the
type
:However, not specifying a
type
is perfectly fine in TypeORM (it will pick a basic column type based on the Typescript type) and most of our entities are defined that way. It does not make sense to add hundreds oftype
properties on the fields of all of our entities just to make this check work. However, we would like to use this check to catch nullability inconsistencies. It seems to me that, even though the plugin has no opinion on whether the column is (e.g.)number | null
orstring | null
, it should still be able to assess the nullability as an issue on its own.The text was updated successfully, but these errors were encountered: