From 65d03ab8c153154eabe5c2b7d107f3cc3b4e1381 Mon Sep 17 00:00:00 2001 From: Andrii Vorobiov Date: Mon, 14 Jun 2021 11:58:21 +0300 Subject: [PATCH] ui: disallow imports from cluster-ui sources Db Console depends on local `cluster-ui` package that and it was possible to specify imports to its modules as a paths to source modules or use exported `index` file which is an entry point for bundled module. `cluster-ui` package has to be built before imports in Db Console because it has its own dependencies and build process which isn't compatible with build process of Db Console. To prevent incorrect imports, this change adds es lint rule to prohibit any imports from `@cockroachlabs/cluster-ui/src/*` path. Release note: none --- pkg/ui/.eslintrc.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/ui/.eslintrc.json b/pkg/ui/.eslintrc.json index 9949741a0888..9a28b421df56 100644 --- a/pkg/ui/.eslintrc.json +++ b/pkg/ui/.eslintrc.json @@ -8,6 +8,9 @@ "react/no-unescaped-entities": "off", "@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "off", + "no-restricted-imports": ["error", { + "patterns": ["@cockroachlabs/cluster-ui/src/*"] + }] } }