From d2ecbc609b7f76307ce23c57fffe24b6ede9c375 Mon Sep 17 00:00:00 2001 From: Christopher Fitzner Date: Tue, 22 Aug 2023 14:45:21 -0700 Subject: [PATCH] ui: lint for usages of console logging In order to provide more structured error data in management-console, setLogger and getLogger methods were previously added to cluster-ui. They allow the logger to be overridden when used from the cloud. The benefits rely on using the new methods in console-ui instead of console logging methods. This change adds a lint rule to ensure console logging methods are not used. CC-24092 Epic: none Release note: none --- pkg/ui/workspaces/cluster-ui/.eslintrc.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/ui/workspaces/cluster-ui/.eslintrc.json b/pkg/ui/workspaces/cluster-ui/.eslintrc.json index 0c112d46dd52..931bfb8cc259 100644 --- a/pkg/ui/workspaces/cluster-ui/.eslintrc.json +++ b/pkg/ui/workspaces/cluster-ui/.eslintrc.json @@ -11,6 +11,9 @@ "@typescript-eslint/no-explicit-any": "warn", "@typescript-eslint/no-namespace": "off", "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], - "@cockroachlabs/crdb/require-antd-style-import": "error" + "@cockroachlabs/crdb/require-antd-style-import": "error", + // Instead of using console log methods directly, cluster-ui code should + // call the getLogger() method to provide the appropriate logger. + "no-console": "error" } }