Enforce strict required type matching between mongoose and typescript
This rule aimed at detecting inconsistent mongoose field required type declaration in schema as nethier typescript or mongoose complains about it.
class User {
@Prop({ required: true })
userId: string;
}
class User {
@Prop({ required: true })
userId?: string; // userId is optional but required in mongoose
}