Open micalevisk opened 12 months ago
yea i understand what you mean. This kind of thing is perfect for ESLint to catch for sure.
It could be as simple as matching the strings because its unlikely a dev would call a pipe APP_PIPE. It might cause issues but the rule could be disabled individually for the line in those cases.
as mentioned here: https://github.com/nestjs/docs.nestjs.com/issues/2178 we can't do
app.get(APP_GUARD)
/app.get(APP_PIPE)
/app.get(APP_FILTER)
/app.get(APP_INTERCEPTOR)
due to how those "providers" works. I tested it myself.thus I'd like to have a rule that forbids calling
app.get
over then so we can prevent misusages that will lead to runtime errorsAlso, I believe we can extend this to
@Inject(APP_*)
as well due to the same reason