Lint rule to catch && / || misuse inside .where() queries #5707
hshoja
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I noticed that using JavaScript logical operators (
&&,||) inside Drizzle's.where()silently drops conditions, only the last operand is applied.I wrote a lint script (Deno) + ESLint rule (Node) to catch this at CI time:
https://gist.github.com/hshoja/17218577b4dd57f642d523efeecfb3df
Complements the official
eslint-plugin-drizzlewhich covers missing.where()but not wrong operators inside.where().Would love to hear if others have hit this or have alternative approaches.
All reactions