Skip to content

Commit

Permalink
ui: disallow imports from cluster-ui sources
Browse files Browse the repository at this point in the history
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
  • Loading branch information
koorosh committed Jun 14, 2021
1 parent c269765 commit 65d03ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/ui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"]
}]
}
}

0 comments on commit 65d03ab

Please sign in to comment.