darraghoriordan / eslint-plugin-nestjs-typed

Some eslint rules for working with NestJs projects
http://www.darraghoriordan.com
171 stars 34 forks source link

fix: validated-non-primitive-property-needs-type-decorator not understanding union between primitive array | null #39

Closed austinwoon closed 1 year ago

austinwoon commented 1 year ago

Problem

@darraghor/nestjs-typed/validated-non-primitive-property-needs-type-decorator does not understand that types of primitive array | null does not need a @Type decorator

Example

class GetUserReq {
    @IsString({each: true})
    emails: string[] | null
}

Linter would tell us we need to have a Type decorator when we do not need it. The error disappears when i remove the union with null

darraghoriordan commented 1 year ago

:tada: This issue has been resolved in version 3.17.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: