From fedd7b3926540fdf3137f327cac917237a438943 Mon Sep 17 00:00:00 2001 From: Pranav <38887390+thecmdrunner@users.noreply.github.com> Date: Sun, 24 Mar 2024 18:19:15 +0530 Subject: [PATCH] feat: apply drizzle lint rules to `db` keyword only (#1808) Co-authored-by: Julius Marminge --- .changeset/violet-plums-sparkle.md | 5 +++++ cli/src/installers/eslint.ts | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .changeset/violet-plums-sparkle.md diff --git a/.changeset/violet-plums-sparkle.md b/.changeset/violet-plums-sparkle.md new file mode 100644 index 0000000000..bfe9b7d8cd --- /dev/null +++ b/.changeset/violet-plums-sparkle.md @@ -0,0 +1,5 @@ +--- +"create-t3-app": patch +--- + +Apply drizzle-orm lint rules for `db` keyword only diff --git a/cli/src/installers/eslint.ts b/cli/src/installers/eslint.ts index 706447d944..941d7604b9 100644 --- a/cli/src/installers/eslint.ts +++ b/cli/src/installers/eslint.ts @@ -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;