Skip to content

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

chore: fix eslint errors (#2088)

boojacke78409c05f4b
diff --git a/frontend/src/bbkit/BBModal.vue b/frontend/src/bbkit/BBModal.vue
index 6cdb19a261..29bdd9d091 100644
--- a/frontend/src/bbkit/BBModal.vue
+++ b/frontend/src/bbkit/BBModal.vue
@@ -45,7 +45,6 @@ import {
ref,
Ref,
RenderFunction,
- VNode,
} from "vue";
import { useModalStack } from "./BBModalStack.vue";
diff --git a/frontend/src/components/AlterSchemaPrepForm/ProjectTenantView.vue b/frontend/src/components/AlterSchemaPrepForm/ProjectTenantView.vue
index a9613bc202..c4cca00725 100644
--- a/frontend/src/components/AlterSchemaPrepForm/ProjectTenantView.vue
+++ b/frontend/src/components/AlterSchemaPrepForm/ProjectTenantView.vue
@@ -116,7 +116,7 @@
<script lang="ts" setup>
/* eslint-disable vue/no-mutating-props */
-import { computed, watchEffect, watch, ref, h, useSlots } from "vue";
+import { computed, watchEffect, watch, ref, h } from "vue";
import { NCollapse, NCollapseItem } from "naive-ui";
import { groupBy } from "lodash-es";
import { Translation, useI18n } from "vue-i18n";
diff --git a/frontend/src/components/Breadcrumb.vue b/frontend/src/components/Breadcrumb.vue
index fcd401c1b6..90271fe474 100644
--- a/frontend/src/components/Breadcrumb.vue
+++ b/frontend/src/components/Breadcrumb.vue
@@ -82,6 +82,7 @@ interface BreadcrumbItem {
}
export default defineComponent({
+ // eslint-disable-next-line vue/multi-word-component-names
name: "Breadcrumb",
components: {
HelpTriggerIcon,
diff --git a/frontend/src/components/InputWithTemplate/InputWithTemplate.vue b/frontend/src/components/InputWithTemplate/InputWithTemplate.vue
index d876e7321d..0213fef7dc 100644
--- a/frontend/src/components/InputWithTemplate/InputWithTemplate.vue
+++ b/frontend/src/components/InputWithTemplate/InputWithTemplate.vue
@@ -116,7 +116,7 @@ watchEffect(() => {
});
const onWindowResize = () => {
- if (containerRef && containerRef.value) {
+ if (containerRef.value) {
state.inputMaxWidth = containerRef.value.offsetWidth;
}
};
@@ -183,7 +183,7 @@ const onTemplateAdd = (template: Template) => {
});
state.inputData = "";
- if (inputRef && inputRef.value) {
+ if (inputRef.value) {
inputRef.value.focus();
}
};
diff --git a/frontend/src/components/Issue/TaskCheckRunPanel.vue b/frontend/src/components/Issue/TaskCheckRunPanel.vue
index 76041b6de9..1e42d83aba 100644
--- a/frontend/src/components/Issue/TaskCheckRunPanel.vue
+++ b/frontend/src/components/Issue/TaskCheckRunPanel.vue
@@ -156,7 +156,6 @@ export default defineComponent({
case SQLReviewPolicyErrorCode.FK_IN_TABLE:
case SQLReviewPolicyErrorCode.TABLE_DROP_NAMING_CONVENTION:
case SQLReviewPolicyErrorCode.DATABASE_NOT_EMPTY:
- // CompatibilityErrorCode
case CompatibilityErrorCode.COMPATIBILITY_DROP_DATABASE:
case CompatibilityErrorCode.COMPATIBILITY_RENAME_TABLE:
case CompatibilityErrorCode.COMPATIBILITY_DROP_TABLE:
@@ -167,7 +166,7 @@ export default defineComponent({
case CompatibilityErrorCode.COMPATIBILITY_ADD_FOREIGN_KEY:
case CompatibilityErrorCode.COMPATIBILITY_ADD_CHECK:
case CompatibilityErrorCode.COMPATIBILITY_ALTER_CHECK:
- case CompatibilityErrorCode.COMPATIBILITY_ALTER_COLUMN:
+ case CompatibilityErrorCode.COMPATIBILITY_ALTER_COLUMN: {
const rule = ruleTemplateMap.get(checkResult.title as RuleType);
if (rule) {
@@ -179,6 +178,7 @@ export default defineComponent({
title = checkResult.title;
}
break;
+ }
}
return title ? `${title} (${checkResult.code})` : checkResult.title;
@@ -196,7 +196,7 @@ export default defineComponent({
target: "_self",
url: "/setting/sql-review",
};
- default:
+ default: {
const url = `https://www.bytebase.com/docs/reference/error-code/${
checkResult.namespace === "bb.advisor" ? "advisor" : "core"
}?source=console`;
@@ -205,6 +205,7 @@ export default defineComponent({
target: "__blank",
url: url,
};
+ }
}
};
diff --git a/frontend/src/components/SQLReview/SQLReviewInfo.vue b/frontend/src/components/SQLReview/SQLReviewInfo.vue
index 14f5530d78..8c0dc9986c 100644
--- a/frontend/src/components/SQLReview/SQLReviewInfo.vue
+++ b/frontend/src/components/SQLReview/SQLReviewInfo.vue
@@ -34,21 +34,21 @@
"
class="mb-5"
/>
- <div class="flex flex-wrap gap-x-3" v-if="!isEdit">
+ <div v-if="!isEdit" class="flex flex-wrap gap-x-3">
<div
v-for="env in environmentList"
:key="env.id"
class="flex items-center"
>
<input
- type="radio"
:id="`${env.id}`"
+ type="radio"
:value="env.id"
:disabled="env.disabled"
:checked="env.id === selectedEnvironment?.id"
- @change="$emit('env-change', env)"
class="text-accent disabled:text-accent-disabled focus:ring-accent"
:class="env.disabled ? 'cursor-not-allowed' : 'cursor-pointer'"
+ @change="$emit('env-change', env)"
/>
<label
:for="`${env.id}`"
@@ -70,7 +70,7 @@
/>
</div>
<div>
- <div class="mt-5" v-if="isEdit">
+ <div v-if="isEdit" class="mt-5">
<div
class="flex cursor-pointer items-center text-indigo-500"
@click="state.openTemplate = !state.openTemplate"
@@ -88,8 +88,8 @@
:required="false"
:template-list="templateList"
:selected-template-index="selectedTemplateIndex"
- @select="(index) => $emit('select-template', index)"
class="mx-5 mt-5"
+ @select="(index) => $emit('select-template', index)"
/>
</div>
<SQLReviewTemplates
@@ -169,6 +169,6 @@ const environmentList = computed((): LocalEnvironment[] => {
});
const onNameChange = (event: Event) => {
- emit("name-change", (<HTMLInputElement>event.target).value);
+ emit("name-change", (event.target as HTMLInputElement).value);
};
</script>
diff --git a/frontend/src/types/sqlReview.ts b/frontend/src/types/sqlReview.ts
index 47aa4b2411..efaf2d960b 100644
--- a/frontend/src/types/sqlReview.ts
+++ b/frontend/src/types/sqlReview.ts
@@ -224,7 +224,6 @@ export const convertToCategoryList = (
const dict = ruleList.reduce((dict, rule) => {
if (!dict[rule.category]) {
- const id = rule.category.toLowerCase();
dict[rule.category] = {
id: rule.category,
ruleList: [],
@@ -338,7 +337,7 @@ export const convertPolicyRuleToRuleTemplate = (
},
],
};
- case "column.required":
+ case "column.required": {
const requiredColumnComponent = ruleTemplate.componentList[0];
const requiredColumnPayload = {
...requiredColumnComponent.payload,
@@ -353,6 +352,7 @@ export const convertPolicyRuleToRuleTemplate = (
},
],
};
+ }
}
throw new Error(`Invalid rule ${ruleTemplate.type}`);
@@ -419,7 +419,7 @@ export const convertRuleTemplateToPolicyRule = (
maxLength: numberPayload.value ?? numberPayload.default,
},
};
- case "column.required":
+ case "column.required": {
const stringArrayPayload = rule.componentList[0]
.payload as StringArrayPayload;
return {
@@ -428,6 +428,7 @@ export const convertRuleTemplateToPolicyRule = (
columnList: stringArrayPayload.value ?? stringArrayPayload.default,
},
};
+ }
}
throw new Error(`Invalid rule ${rule.type}`);
diff --git a/frontend/src/views/sql-editor/EditorHeader.vue b/frontend/src/views/sql-editor/EditorHeader.vue
index 0a3cc7bd85..212c2622dc 100644
--- a/frontend/src/views/sql-editor/EditorHeader.vue
+++ b/frontend/src/views/sql-editor/EditorHeader.vue
@@ -106,16 +106,10 @@ import { computed, reactive, watchEffect, defineComponent } from "vue";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
import { useLocalStorage } from "@vueuse/core";
-import { storeToRefs } from "pinia";
import ProfileDropdown from "@/components/ProfileDropdown.vue";
import { UNKNOWN_ID } from "@/types";
import { isDBAOrOwner, isDev } from "@/utils";
-import {
- hasFeature,
- useCurrentUser,
- useInboxStore,
- useSubscriptionStore,
-} from "@/store";
+import { hasFeature, useCurrentUser, useInboxStore } from "@/store";
interface LocalState {
showMobileMenu: boolean;
@@ -127,7 +121,6 @@ export default defineComponent({
setup() {
const { t, availableLocales, locale } = useI18n();
const inboxStore = useInboxStore();
- const subscriptionStore = useSubscriptionStore();
const router = useRouter();
const state = reactive<LocalState>({
@@ -136,8 +129,6 @@ export default defineComponent({
const currentUser = useCurrentUser();
- const { currentPlan } = storeToRefs(subscriptionStore);
-
const showDBAItem = computed((): boolean => {
return (
!hasFeature("bb.feature.dba-workflow") ||