Skip to content
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

Should ignore non-verifiable types - param-decorator-name-matches-route-param #69

Open
kurt-west opened this issue Jun 20, 2023 · 0 comments

Comments

@kurt-west
Copy link

Currently this rule will skip if the parameter is of type Identifier or TemplateLiteral. Along the same lines, I believe it should skip if the parameter is of type MemberExpression (Enum or Static Class Method).

For example, the below will trigger an error.

enum AppRoutes {
  Root = 'app',
  VerifyParams = ':id',
}

@Controller(AppRoutes.Root)
export class AppController {

  @Post(AppRoutes.VerifyParams)
  verifyParams(@Param('id', ParseUUIDPipe) id: string): VerifyParamsResponseDto {
    return new VerifyParamsResponseDto({ token: id });
  }
}

Another option would be to skip if the parameter is not of type Literal, ArrayExpression, or ObjectExpression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants