From 590ce49f15438265dd15f9c963c5b08e1f964d40 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 9 Apr 2025 18:02:49 -0400 Subject: [PATCH] Add eslint rules for restricted imports --- eslint.config.mjs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index e094230ec..9c0ff1326 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -128,7 +128,35 @@ export default tseslint.config( '@stylistic/quotes': ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': false }], '@stylistic/semi': 'error', '@stylistic/space-before-blocks': 'error', - '@stylistic/space-infix-ops': 'error' + '@stylistic/space-infix-ops': 'error', + + '@typescript-eslint/no-restricted-imports': [ + 'error', + { + paths: [ + { + name: '@jellyfin/sdk/lib/generated-client', + message: 'Use direct file imports for tree-shaking', + allowTypeImports: true + }, + { + name: '@jellyfin/sdk/lib/generated-client/api', + message: 'Use direct file imports for tree-shaking', + allowTypeImports: true + }, + { + name: '@jellyfin/sdk/lib/generated-client/models', + message: 'Use direct file imports for tree-shaking', + allowTypeImports: true + }, + { + name: '@mui/material', + message: 'Use direct file imports for tree-shaking', + allowTypeImports: true + } + ] + } + ] } },