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

[BUG]: Drizzle eslint bug --> it screams at you for not using where anytime delete keyword is used, even beyond drizzle context #2907

Closed
rtpa25 opened this issue Sep 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rtpa25
Copy link

rtpa25 commented Sep 5, 2024

What version of drizzle-orm are you using?

0.30.10

What version of drizzle-kit are you using?

0.21.2

Describe the Bug

Screen Shot 2024-09-05 at 09 36 03 AM
Whenever I use such delete keyword, may it be built in js functions or a delete function from one of my own services

ex: teamService.delete() it detects the delete keyword and screams at for not using .where

Expected behavior

It should only complain about this in context of drizzle queries

Environment & setup

No response

@rtpa25 rtpa25 added the bug Something isn't working label Sep 5, 2024
@rphlmr
Copy link

rphlmr commented Sep 5, 2024

👋 You can fix this with:

   "drizzle/enforce-delete-with-where": [
      "error",
      {
        drizzleObjectName: ["db", "tx"],
      },
    ],
    "drizzle/enforce-update-with-where": [
      "error",
      {
        drizzleObjectName: ["db", "tx"],
      },
    ]

https://orm.drizzle.team/docs/eslint-plugin#enforce-delete-with-where

@rtpa25
Copy link
Author

rtpa25 commented Sep 11, 2024

👋 You can fix this with:

   "drizzle/enforce-delete-with-where": [
      "error",
      {
        drizzleObjectName: ["db", "tx"],
      },
    ],
    "drizzle/enforce-update-with-where": [
      "error",
      {
        drizzleObjectName: ["db", "tx"],
      },
    ]

https://orm.drizzle.team/docs/eslint-plugin#enforce-delete-with-where

Thanks a lot @rphlmr

@rtpa25 rtpa25 closed this as completed Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants