You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as mentioned here: nestjs/docs.nestjs.com#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 errors
Also, I believe we can extend this to @Inject(APP_*) as well due to the same reason
The text was updated successfully, but these errors were encountered:
micalevisk
changed the title
rule suggestion: forbids app.get() over APP_* tokens
New Rule Suggestion: forbids app.get() over APP_* tokens
Nov 19, 2023
micalevisk
changed the title
New Rule Suggestion: forbids app.get() over APP_* tokens
New Rule Suggestion: forbids app.get() for APP_* tokens
Nov 19, 2023
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: nestjs/docs.nestjs.com#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 reasonThe text was updated successfully, but these errors were encountered: