diff --git a/eslint.config.mjs b/eslint.config.mjs index db57827354..647a46d291 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -53,19 +53,6 @@ export default defineConfig([ 'react/no-unescaped-entities': 'off', 'react/no-find-dom-node': 'off', - // IMPORTS - 'no-restricted-imports': [ - 'error', - { - paths: [ - { - name: 'vitest', - message: 'Please use @semcore/testing-utils/vitest instead of importing from vitest directly.', - }, - ], - }, - ], - // TYPESCRIPT '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-empty-object-type': 'off', @@ -118,4 +105,26 @@ export default defineConfig([ 'no-console': 'off', }, }, + { + files: ['stories/**/*.{ts,tsx}', 'playground/**/*.{ts,tsx}'], + rules: { + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: 'vitest', + message: 'Please use @semcore/testing-utils/vitest instead of importing from vitest directly.', + }, + ], + patterns: [ + { + regex: '^@semcore\\/(?!ui\\/|icon|illustration)', + message: 'Please use imports from @package/ui/* (except @semcore/icon and @semcore/illustration)', + }, + ], + }, + ], + }, + }, ]);