darraghoriordan / eslint-plugin-nestjs-typed

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

Extend rule: "param-decorator-name-matches-route-param" #55

Open ScrapsPrograms opened 1 year ago

ScrapsPrograms commented 1 year ago

I'm new to NestJS but have learned a lot in the past few weeks. One of those things is that it's possible to set route params using the built-in RouterModule.register() function.

image

Now, I noticed in the TicketController (which is the Controller used by the TicketModule), I cannot access the declared :columnid param. I've checked the express req.params object and it does contain this param with the correct value. Is it possible for this rule to be updated to check if any Module uses the RouterModule.register() function and, if so, check for any registered params?

image

I understand my request may be a relatively specific use-case, maybe even an edge-case, but given the scalability of my application it would make it much harder to manage if I needed to specify each path-piece in every submodule or controller.