From 1b2968e61a8f7f6295b3bc401df4c02b1af1e61c Mon Sep 17 00:00:00 2001 From: Slizhevsky Vladislav Date: Tue, 25 Aug 2026 12:01:21 +0200 Subject: [PATCH] [chore] restrict imports from 'semcore/package' for stories and playground --- eslint.config.mjs | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) 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)', + }, + ], + }, + ], + }, + }, ]);