From d36fff177f35a8b3ff0074bf4cd6e56e28141600 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 29 Sep 2026 15:30:11 +0200 Subject: [PATCH] Restrict imports from @prisma/client --- apps/api/eslint.config.cjs | 5 ++++- eslint.config.cjs | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/api/eslint.config.cjs b/apps/api/eslint.config.cjs index 043802a0df..07054e44b9 100644 --- a/apps/api/eslint.config.cjs +++ b/apps/api/eslint.config.cjs @@ -21,7 +21,10 @@ module.exports = [ { files: ['**/*.ts', '**/*.tsx'], // Override or add rules here - rules: {} + rules: { + // TODO: Remove once the API uses the code generated by the new prisma-client generator + '@typescript-eslint/no-restricted-imports': 'off' + } }, { files: ['**/*.js', '**/*.jsx'], diff --git a/eslint.config.cjs b/eslint.config.cjs index 1b4aa6a0c0..ee5e0a557c 100644 --- a/eslint.config.cjs +++ b/eslint.config.cjs @@ -83,6 +83,18 @@ module.exports = [ } ], '@typescript-eslint/no-non-null-assertion': 'warn', + '@typescript-eslint/no-restricted-imports': [ + 'error', + { + paths: [ + { + message: + 'Import the types from @ghostfolio/prisma/browser and the enums from @ghostfolio/prisma/enums instead.', + name: '@prisma/client' + } + ] + } + ], '@typescript-eslint/no-shadow': [ 'warn', {