Browse Source

Restrict imports from @prisma/client

pull/7868/head
Thomas Kaul 2 weeks ago
parent
commit
d36fff177f
  1. 5
      apps/api/eslint.config.cjs
  2. 12
      eslint.config.cjs

5
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'],

12
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',
{

Loading…
Cancel
Save