Closed ChrisMBarr closed 3 months ago
Very coincidentally, I ran into the same issue within 12 hours of you! Small world...
In my case, I had a union type of literal values, so extending your example:
@IsNotEmpty()
@IsString()
Profile!: 'ZCATS' | 'XDOGS' | 'YBIRDS';
and was getting the same linting error even though @Type()
is not appropriate.
I've opened a PR #188 as it turned out to be a pretty easy fix.
Oh wow, well that's great! Perhaps another workaround would be that if you use the @Equals('foo')
decorator then no others should be required - if you only care about specific values then the overall type doesn't really matter.
Would your PR also take care of #187 I opened yesterday as well?
I think it will, I definitely fixed union types of literal strings, so I think union types of literal numbers is probably fixed as well!
:tada: This issue has been resolved in version 5.0.10 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I have certain properties that require explicit values to always be sent, like this:
But I am getting this linting error for both of these cases
I feel like I am validating these correctly for what I need, but this rule is telling me to do something that I'm pretty sure I'm already doing