Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: lint (#17453)

p0ny08f699ebed2e
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskForm.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskForm.vue
index fd4b706599..7aac1dd737 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskForm.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskForm.vue
@@ -98,7 +98,7 @@ import { NButton, NInput } from "naive-ui";
import { computed, reactive, watch } from "vue";
import ExprEditor from "@/components/ExprEditor";
import LearnMoreLink from "@/components/LearnMoreLink.vue";
-import type { ConditionGroupExpr, SimpleExpr } from "@/plugins/cel";
+import type { ConditionGroupExpr, Factor, SimpleExpr } from "@/plugins/cel";
import { ExprType } from "@/plugins/cel";
import {
resolveCELExpr,
@@ -152,7 +152,7 @@ const state = reactive<LocalState>({
});
const mode = computed(() => context.dialog.value?.mode ?? "CREATE");
-const extractFactorList = (expr: SimpleExpr): string[] => {
+const extractFactorList = (expr: SimpleExpr): Factor[] => {
switch (expr.type) {
case ExprType.Condition:
return expr.args.length > 1 ? [expr.args[0]] : [];
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
index 10ac70317d..f8c98fe2e2 100644
--- a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
+++ b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
@@ -72,27 +72,27 @@ export const orderByLevelDesc = (a: Risk, b: Risk): number => {
return a.name < b.name ? -1 : 1;
};
-const commonFactorList = [
+const commonFactorList: Factor[] = [
"environment_id", // use `environment.resource_id` instead.
"project_id", // use `project.resource_id` instead.
"instance_id", // use `instance.resource_id` instead.
"db_engine",
] as const;
-const schemaObjectNameFactorList = [
+const schemaObjectNameFactorList: Factor[] = [
"database_name",
"schema_name",
"table_name",
] as const;
-const migrationFactorList = [
+const migrationFactorList: Factor[] = [
"affected_rows",
"table_rows",
"sql_type",
"sql_statement",
] as const;
-export const RiskSourceFactorMap: Map<Risk_Source, string[]> = new Map([
+export const RiskSourceFactorMap: Map<Risk_Source, Factor[]> = new Map([
[
Risk_Source.DDL,
[
@@ -292,6 +292,8 @@ export const getOptionConfigMap = (source: Risk_Source) => {
case "role":
options = getRoleOptions();
break;
+ default:
+ throw new Error(`Unsupported factor: ${factor}`);
}
map.set(factor, {
remote: false,
diff --git a/frontend/src/components/DatabaseDetail/SQLEditorButtonV1.vue b/frontend/src/components/DatabaseDetail/SQLEditorButtonV1.vue
index 84e6aace03..365f86186a 100644
--- a/frontend/src/components/DatabaseDetail/SQLEditorButtonV1.vue
+++ b/frontend/src/components/DatabaseDetail/SQLEditorButtonV1.vue
@@ -80,7 +80,7 @@ const gotoSQLEditor = () => {
return;
}
- const database = props.database as ComposedDatabase;
+ const database = props.database;
if (database.project === DEFAULT_PROJECT_NAME) {
if (!hasProjectPermissionV2(defaultProject(), "bb.sql.select")) {
// For unassigned databases, only high-privileged users
diff --git a/frontend/src/components/DatabaseGroup/DatabaseGroupForm.vue b/frontend/src/components/DatabaseGroup/DatabaseGroupForm.vue
index b6820d535a..104e3dceca 100644
--- a/frontend/src/components/DatabaseGroup/DatabaseGroupForm.vue
+++ b/frontend/src/components/DatabaseGroup/DatabaseGroupForm.vue
@@ -144,7 +144,7 @@ onMounted(async () => {
return;
}
- const databaseGroupEntity = databaseGroup as DatabaseGroup;
+ const databaseGroupEntity = databaseGroup;
const [, databaseGroupName] = getProjectNameAndDatabaseGroupName(
databaseGroup.name
);
@@ -263,7 +263,7 @@ const doConfirm = async () => {
}
await dbGroupStore.updateDatabaseGroup(
{
- ...props.databaseGroup!,
+ ...props.databaseGroup,
title: formState.placeholder,
databaseExpr: create(ExprSchema, {
expression: celString,
diff --git a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/common.ts b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/common.ts
index 964e647a04..c8c4faebd9 100644
--- a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/common.ts
+++ b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/common.ts
@@ -170,12 +170,7 @@ export const flattenTreeOptions = (
options: DatabaseTreeOption[]
): DatabaseTreeOption[] => {
return options.flatMap((option) => {
- return [
- option,
- ...flattenTreeOptions(
- (option.children as DatabaseTreeOption[] | undefined) ?? []
- ),
- ];
+ return [option, ...flattenTreeOptions(option.children ?? [])];
});
};
diff --git a/frontend/src/components/IdentityProvider/IdentityProviderEditForm.vue b/frontend/src/components/IdentityProvider/IdentityProviderEditForm.vue
index 06a6093241..33800ed7d3 100644
--- a/frontend/src/components/IdentityProvider/IdentityProviderEditForm.vue
+++ b/frontend/src/components/IdentityProvider/IdentityProviderEditForm.vue
@@ -464,7 +464,7 @@ const buildUpdatedIdentityProvider = (): IdentityProvider => {
});
}
- return result as IdentityProvider;
+ return result;
};
const initializeFromProps = () => {
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
index d8f4fb3caf..8f06d4fb68 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
@@ -230,7 +230,7 @@ const createSheets = async () => {
const engine = await databaseEngineForSpec(spec);
sheet.engine = engine;
pendingCreateSheetMap.set(sheet.name, sheet);
- await maybeFormatSQL(sheet, engine as Engine);
+ await maybeFormatSQL(sheet, engine);
}
}
const pendingCreateSheetList = Array.from(pendingCreateSheetMap.values());
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/request/TinySQLEditorButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/request/TinySQLEditorButton.vue
index e5f74558c6..ba80409c77 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/request/TinySQLEditorButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/request/TinySQLEditorButton.vue
@@ -35,8 +35,8 @@ const gotoSQLEditor = async () => {
conditionExpression.databaseResources !== undefined &&
conditionExpression.databaseResources.length > 0
) {
- const databaseResourceName = conditionExpression.databaseResources[0]
- .databaseFullName as string;
+ const databaseResourceName =
+ conditionExpression.databaseResources[0].databaseFullName;
const db =
await useDatabaseV1Store().getOrFetchDatabaseByName(databaseResourceName);
if (isValidDatabaseName(db.name)) {
diff --git a/frontend/src/components/IssueV1/components/IssueLabelSelector.vue b/frontend/src/components/IssueV1/components/IssueLabelSelector.vue
index 1922a4a076..599e865d47 100644
--- a/frontend/src/components/IssueV1/components/IssueLabelSelector.vue
+++ b/frontend/src/components/IssueV1/components/IssueLabelSelector.vue
@@ -98,7 +98,7 @@ const onLabelsUpdate = async (labels: string[]) => {
};
const renderLabel = (option: IssueLabelOption, selected: boolean) => {
- const { color, value } = option as IssueLabelOption;
+ const { color, value } = option;
return h("div", { class: "flex items-center gap-x-2" }, [
h(NCheckbox, { checked: selected, size: "small" }),
h("div", {
diff --git a/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue b/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue
index 37518ee92e..75d6d59755 100644
--- a/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue
+++ b/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue
@@ -226,7 +226,7 @@ import {
BatchSkipTasksRequestSchema,
BatchCancelTaskRunsRequestSchema,
} from "@/types/proto-es/v1/rollout_service_pb";
-import type { Task, TaskRun } from "@/types/proto-es/v1/rollout_service_pb";
+import type { Task } from "@/types/proto-es/v1/rollout_service_pb";
import {
Task_Status,
TaskRun_Status,
@@ -439,7 +439,7 @@ const handleConfirm = async (action: TaskRolloutAction) => {
);
return currentRunningTaskRun;
})
- .filter((taskRun) => taskRun !== undefined) as TaskRun[];
+ .filter((taskRun) => taskRun !== undefined);
if (taskRunListToCancel.length > 0) {
const request = create(BatchCancelTaskRunsRequestSchema, {
parent: `${stage.name}/tasks/-`,
diff --git a/frontend/src/components/MonacoEditor/utils.ts b/frontend/src/components/MonacoEditor/utils.ts
index d8ec47ed67..18b9cad752 100644
--- a/frontend/src/components/MonacoEditor/utils.ts
+++ b/frontend/src/components/MonacoEditor/utils.ts
@@ -147,7 +147,7 @@ export const progressiveDelay = (serial: number) => {
export const positionWithOffset = (
line: number,
column: number,
- selection?: Selection | undefined | null
+ selection?: Selection | null
) => {
if (!selection || selection.isEmpty()) {
return [line, column];
diff --git a/frontend/src/components/Plan/components/Configuration/InstanceRoleSection/context.ts b/frontend/src/components/Plan/components/Configuration/InstanceRoleSection/context.ts
index bce9228ce0..0deaa63cb2 100644
--- a/frontend/src/components/Plan/components/Configuration/InstanceRoleSection/context.ts
+++ b/frontend/src/components/Plan/components/Configuration/InstanceRoleSection/context.ts
@@ -7,11 +7,7 @@ import { isValidDatabaseName } from "@/types";
import { Engine } from "@/types/proto-es/v1/common_pb";
import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";
-import type {
- Plan,
- Plan_Spec,
- Plan_ChangeDatabaseConfig,
-} from "@/types/proto-es/v1/plan_service_pb";
+import type { Plan, Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";
import type { Project } from "@/types/proto-es/v1/project_service_pb";
import type { Task, Rollout } from "@/types/proto-es/v1/rollout_service_pb";
import { Task_Status, Task_Type } from "@/types/proto-es/v1/rollout_service_pb";
@@ -86,8 +82,7 @@ export const provideInstanceRoleSettingContext = (refs: {
taskType = task?.type;
} else {
// For creating mode, we can infer from the change type
- const config = selectedSpec.value.config
- .value as Plan_ChangeDatabaseConfig;
+ const config = selectedSpec.value.config.value;
// Check if it's a schema or data update based on the config
taskType = config.sheet
? Task_Type.DATABASE_SCHEMA_UPDATE
diff --git a/frontend/src/components/Plan/components/Configuration/TransactionModeSection/context.ts b/frontend/src/components/Plan/components/Configuration/TransactionModeSection/context.ts
index 7443eaa9ce..ce11d83b5e 100644
--- a/frontend/src/components/Plan/components/Configuration/TransactionModeSection/context.ts
+++ b/frontend/src/components/Plan/components/Configuration/TransactionModeSection/context.ts
@@ -6,11 +6,7 @@ import { useDatabaseV1Store } from "@/store";
import { isValidDatabaseName } from "@/types";
import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";
-import type {
- Plan,
- Plan_Spec,
- Plan_ChangeDatabaseConfig,
-} from "@/types/proto-es/v1/plan_service_pb";
+import type { Plan, Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";
import type { Project } from "@/types/proto-es/v1/project_service_pb";
import type { Task, Rollout } from "@/types/proto-es/v1/rollout_service_pb";
import { Task_Status, Task_Type } from "@/types/proto-es/v1/rollout_service_pb";
@@ -85,8 +81,7 @@ export const provideTransactionModeSettingContext = (refs: {
taskType = task?.type;
} else {
// For creating mode, we can infer from the change type
- const config = selectedSpec.value.config
- .value as Plan_ChangeDatabaseConfig;
+ const config = selectedSpec.value.config.value;
// Check if it's a schema or data update based on the config
taskType = config.sheet
? Task_Type.DATABASE_SCHEMA_UPDATE
diff --git a/frontend/src/components/Plan/logic/context.ts b/frontend/src/components/Plan/logic/context.ts
index c235fcbc4c..bcba0243ca 100644
--- a/frontend/src/components/Plan/logic/context.ts
+++ b/frontend/src/components/Plan/logic/context.ts
@@ -68,7 +68,7 @@ export const usePlanContextWithRollout = () => {
return {
...context,
rollout: context.rollout as Ref<Rollout>,
- taskRuns: context.taskRuns as Ref<TaskRun[]>,
+ taskRuns: context.taskRuns,
};
};
diff --git a/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue b/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue
index a26303d56e..824953ab46 100644
--- a/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue
+++ b/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue
@@ -340,7 +340,7 @@ const onPolicyUpsert = async () => {
};
const factorList = computed((): Factor[] => {
- const list = [
+ const list: Factor[] = [
"environment_id", // using `environment.resource_id`
"project_id", // using `project.resource_id`
"instance_id", // using `instance.resource_id`
diff --git a/frontend/src/composables/useDataLabelAttrs.ts b/frontend/src/composables/useDataLabelAttrs.ts
deleted file mode 100644
index f9d5837dbc..0000000000
--- a/frontend/src/composables/useDataLabelAttrs.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { reactive, useAttrs } from "vue";
-
-const dataLabelRegex = RegExp("data-.+");
-
-const useDataLabelAttrs = (prefix = "", endfix = "") => {
- const attrs = useAttrs();
- const dataLabelAttrs = reactive<any>({});
-
- for (const key in attrs) {
- if (dataLabelRegex.test(key)) {
- dataLabelAttrs[key] = prefix + attrs[key] + endfix;
- }
- }
-
- return dataLabelAttrs;
-};
-
-export default useDataLabelAttrs;
diff --git a/frontend/src/plugins/cel/types/factor.ts b/frontend/src/plugins/cel/types/factor.ts
index da63b28141..01641e2f53 100644
--- a/frontend/src/plugins/cel/types/factor.ts
+++ b/frontend/src/plugins/cel/types/factor.ts
@@ -48,7 +48,7 @@ export const StringFactorList = [
] as const;
export type StringFactor = (typeof StringFactorList)[number];
-export const TimestampFactorList = ["request.time"];
+export const TimestampFactorList = ["request.time"] as const;
export type TimestampFactor = (typeof TimestampFactorList)[number];
export const HighLevelFactorList = ["level", "source"] as const;
diff --git a/frontend/src/plugins/cel/types/operator.ts b/frontend/src/plugins/cel/types/operator.ts
index 8cbd929452..bac6d03147 100644
--- a/frontend/src/plugins/cel/types/operator.ts
+++ b/frontend/src/plugins/cel/types/operator.ts
@@ -129,6 +129,16 @@ const OperatorList: Record<Factor, Operator[]> = {
...CollectionOperatorList,
...StringOperatorList,
]),
+
+ // These factors don't have operator candidates for user selection.
+ "request.export_format": [],
+ "request.row_limit": [],
+ "resource.database": [],
+ "resource.schema": [],
+ "resource.table": [],
+ "resource.column_name": [],
+ "resource.schema_name": [],
+ "request.time": [],
};
export const getOperatorListByFactor = (factor: Factor) => {
diff --git a/frontend/src/store/modules/quickLink.ts b/frontend/src/store/modules/quickLink.ts
index 67b80108de..acc086513e 100644
--- a/frontend/src/store/modules/quickLink.ts
+++ b/frontend/src/store/modules/quickLink.ts
@@ -52,7 +52,7 @@ export function useQuickLink() {
sidebarItem.children.map((child) =>
getAccessListBySidebar(child, sidebarItem.icon)
)
- ).filter((item) => item) as QuickLink[];
+ ).filter((item) => item);
}
return [];
@@ -61,7 +61,7 @@ export function useQuickLink() {
const fullQuickLinkList = computed((): QuickLink[] => {
const accessList = flatten(
dashboardSidebarItemList.value.map((item) => getAccessListBySidebar(item))
- ).filter((item) => item) as QuickLink[];
+ ).filter((item) => item);
accessList.unshift(
{
diff --git a/frontend/src/store/modules/sqlEditor/tree.ts b/frontend/src/store/modules/sqlEditor/tree.ts
index 0c0ac3d016..f75abd2b93 100644
--- a/frontend/src/store/modules/sqlEditor/tree.ts
+++ b/frontend/src/store/modules/sqlEditor/tree.ts
@@ -48,7 +48,7 @@ export const useSQLEditorTreeStore = defineStore("sqlEditorTree", () => {
target: NodeTarget<T>
) => {
const id = idForSQLEditorTreeNodeTarget(type, target);
- return (nodeListMapById.get(id) ?? []) as string[];
+ return nodeListMapById.get(id) ?? [];
};
return {
diff --git a/frontend/src/store/modules/sqlReview.ts b/frontend/src/store/modules/sqlReview.ts
index d643fc8756..4a7f86ffcc 100644
--- a/frontend/src/store/modules/sqlReview.ts
+++ b/frontend/src/store/modules/sqlReview.ts
@@ -193,7 +193,7 @@ export const useSQLReviewStore = defineStore("sqlReview", {
updateMask.push("rules");
patch.rules = ruleList.map((r) => {
return create(SQLReviewRuleSchema, {
- type: r.type as string,
+ type: r.type,
level: r.level,
engine: r.engine,
comment: r.comment,
diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.ts
index 92d6a24429..1811d07eae 100644
--- a/frontend/src/types/plan.ts
+++ b/frontend/src/types/plan.ts
@@ -23,7 +23,7 @@ export const instanceLimitFeature = new Set<PlanFeature>();
PLANS.forEach((plan) => {
planFeatureMatrix.set(plan.type, new Set(plan.features));
});
-(planData as any).instanceFeatures.forEach((feature: string) => {
+planData.instanceFeatures.forEach((feature: string) => {
instanceLimitFeature.add(PlanFeature[feature as keyof typeof PlanFeature]);
});
diff --git a/frontend/src/utils/issue/cel.ts b/frontend/src/utils/issue/cel.ts
index 421da29eb2..9b8700450e 100644
--- a/frontend/src/utils/issue/cel.ts
+++ b/frontend/src/utils/issue/cel.ts
@@ -328,9 +328,7 @@ export const convertFromExpr = (expr: Expr): ConditionExpression => {
conditionExpression.databaseResources?.pop();
if (databaseResource) {
for (const value of values) {
- const temp: DatabaseResource = cloneDeep(
- databaseResource
- ) as DatabaseResource;
+ const temp: DatabaseResource = cloneDeep(databaseResource);
temp.schema = value as string;
conditionExpression.databaseResources!.push(temp);
}
@@ -343,9 +341,7 @@ export const convertFromExpr = (expr: Expr): ConditionExpression => {
conditionExpression.databaseResources?.pop();
if (databaseResource) {
for (const value of values) {
- const temp: DatabaseResource = cloneDeep(
- databaseResource
- ) as DatabaseResource;
+ const temp: DatabaseResource = cloneDeep(databaseResource);
temp.table = value as string;
conditionExpression.databaseResources!.push(temp);
}
diff --git a/frontend/src/utils/web-storage.ts b/frontend/src/utils/web-storage.ts
index 8ec13e7489..41b8eddf8e 100644
--- a/frontend/src/utils/web-storage.ts
+++ b/frontend/src/utils/web-storage.ts
@@ -152,7 +152,7 @@ export const useDynamicLocalStorage = <
key: key.value,
oldValue,
newValue,
- storageArea: storage!,
+ storageArea: storage,
},
})
);
@@ -161,15 +161,15 @@ export const useDynamicLocalStorage = <
function write(v: unknown) {
try {
- const oldValue = storage!.getItem(key.value);
+ const oldValue = storage.getItem(key.value);
if (v == null) {
dispatchWriteEvent(oldValue, null);
- storage!.removeItem(key.value);
+ storage.removeItem(key.value);
} else {
const serialized = serializer.write(v as any);
if (oldValue !== serialized) {
- storage!.setItem(key.value, serialized);
+ storage.setItem(key.value, serialized);
dispatchWriteEvent(oldValue, serialized);
}
}
@@ -179,11 +179,11 @@ export const useDynamicLocalStorage = <
}
function read(event?: StorageEventLike) {
- const rawValue = event ? event.newValue : storage!.getItem(key.value);
+ const rawValue = event ? event.newValue : storage.getItem(key.value);
if (rawValue == null) {
if (writeDefaults && rawInit != null)
- storage!.setItem(key.value, serializer.write(rawInit));
+ storage.setItem(key.value, serializer.write(rawInit));
return rawInit;
} else if (!event && mergeDefaults) {
const value = serializer.read(rawValue);
diff --git a/frontend/src/views/SchemaTemplate/ColumnTypes.vue b/frontend/src/views/SchemaTemplate/ColumnTypes.vue
index 807857e68e..34de65e6db 100644
--- a/frontend/src/views/SchemaTemplate/ColumnTypes.vue
+++ b/frontend/src/views/SchemaTemplate/ColumnTypes.vue
@@ -336,7 +336,7 @@ const handleMySQLTypesChange = async () => {
);
const fieldTemplateTypesOfMySQL = uniq(
mysqlFieldTemplates
- .map((item) => (item.column?.type || "") as string)
+ .map((item) => item.column?.type || "")
.filter(Boolean)
.map((item) => item.toLowerCase())
);
@@ -410,7 +410,7 @@ const handlePostgreSQLTypesChange = async () => {
);
const fieldTemplateTypesOfPostgreSQL = uniq(
postgresFieldTemplates
- .map((item) => (item.column?.type || "") as string)
+ .map((item) => item.column?.type || "")
.filter(Boolean)
.map((item) => item.toLowerCase())
);
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/actions.tsx b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/actions.tsx
index dee0c76376..7dc8d06639 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/actions.tsx
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/actions.tsx
@@ -193,7 +193,7 @@ export const setConnection = (
...extra,
};
const conn = coreTab.connection;
- const database = node.meta.target as ComposedDatabase;
+ const database = node.meta.target;
conn.instance = database.instance;
conn.database = database.name;
setDefaultDataSourceForConn(conn, database);
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
index fd1763914d..904cde8ce5 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
@@ -376,7 +376,7 @@ const updateKeyword = (value: string) => {
const columns = computed(() => {
return props.result.columnNames.map<ColumnDef<QueryRow, RowValue>>(
(columnName, index) => {
- const columnType = props.result.columnTypeNames[index] as string;
+ const columnType = props.result.columnTypeNames[index];
return {
id: `${columnName}@${index}`,
diff --git a/frontend/src/views/sql-editor/EditorCommon/hover-state.ts b/frontend/src/views/sql-editor/EditorCommon/hover-state.ts
index 882031d5a5..5d62e0b3fd 100644
--- a/frontend/src/views/sql-editor/EditorCommon/hover-state.ts
+++ b/frontend/src/views/sql-editor/EditorCommon/hover-state.ts
@@ -11,9 +11,9 @@ export type HoverStateContext<S> = {
update: UpdateFn<S>;
};
-export const useHoverStateContext = <S>(key: string) => {
+export const useHoverStateContext = <S>(key: string): HoverStateContext<S> => {
const KEY = `bb.sql-editor.${key}.hover-state`;
- return inject(KEY)! as HoverStateContext<S>;
+ return inject(KEY)!;
};
export const provideHoverStateContext = <S>(key: string) => {
diff --git a/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/useAttractFocus.ts b/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/useAttractFocus.ts
index 5b6f3d45bf..b74b6d37f0 100644
--- a/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/useAttractFocus.ts
+++ b/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/useAttractFocus.ts
@@ -53,9 +53,7 @@ export const useAttractFocus = (options: MaybeRef<AttractFocusOptions>) => {
return;
}
- const target = document.querySelector(
- targetSelector
- ) as HTMLTextAreaElement | null;
+ const target = document.querySelector<HTMLTextAreaElement>(targetSelector);
// monaco-editor will consume the focus event with key stroke11
target?.focus();
});