Skip to content

Commit

Permalink
feat: apply drizzle lint rules to db keyword only (#1808)
Browse files Browse the repository at this point in the history
Co-authored-by: Julius Marminge <julius0216@outlook.com>
  • Loading branch information
thecmdrunner and juliusmarminge committed Mar 24, 2024
1 parent aeb1fa9 commit fedd7b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-plums-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": patch
---

Apply drizzle-orm lint rules for `db` keyword only
10 changes: 8 additions & 2 deletions cli/src/installers/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ const getEslintConfig = ({ usingDrizzle }: { usingDrizzle: boolean }) => {

eslintConfig.rules = {
...eslintConfig.rules,
"drizzle/enforce-delete-with-where": "error",
"drizzle/enforce-update-with-where": "error",
"drizzle/enforce-delete-with-where": [
"error",
{ drizzleObjectName: ["db"] },
],
"drizzle/enforce-update-with-where": [
"error",
{ drizzleObjectName: ["db"] },
],
};
}
return eslintConfig;
Expand Down

0 comments on commit fedd7b3

Please sign in to comment.