diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 4b04e87a98..11d3112e83 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -93,6 +93,7 @@ const tsRules = defineConfig({ // note you must disable the base rule as it can report incorrect errors "no-shadow": "off", "@typescript-eslint/no-shadow": ["error"], + "@typescript-eslint/no-redundant-type-constituents": "off", }, }).rules; diff --git a/client/components/Chat.vue b/client/components/Chat.vue index 645704e5a9..41f7ca1105 100644 --- a/client/components/Chat.vue +++ b/client/components/Chat.vue @@ -136,6 +136,7 @@ import ListIgnored from "./Special/ListIgnored.vue"; import {defineComponent, PropType, ref, computed, watch, nextTick, onMounted, Component} from "vue"; import type {ClientNetwork, ClientChan} from "../js/types"; import {useStore} from "../js/store"; +import {SpecialChanType, ChanType} from "../../shared/types/chan"; export default defineComponent({ name: "Chat", @@ -161,13 +162,13 @@ export default defineComponent({ const specialComponent = computed(() => { switch (props.channel.special) { - case "list_bans": + case SpecialChanType.BANLIST: return ListBans as Component; - case "list_invites": + case SpecialChanType.INVITELIST: return ListInvites as Component; - case "list_channels": + case SpecialChanType.CHANNELLIST: return ListChannels as Component; - case "list_ignored": + case SpecialChanType.IGNORELIST: return ListIgnored as Component; } @@ -194,7 +195,7 @@ export default defineComponent({ }; const editTopic = () => { - if (props.channel.type === "channel") { + if (props.channel.type === ChanType.CHANNEL) { props.channel.editTopic = true; } }; diff --git a/client/components/ChatInput.vue b/client/components/ChatInput.vue index aa589a1a09..8cc2f8edac 100644 --- a/client/components/ChatInput.vue +++ b/client/components/ChatInput.vue @@ -63,6 +63,7 @@ import eventbus from "../js/eventbus"; import {watch, defineComponent, nextTick, onMounted, PropType, ref, onUnmounted} from "vue"; import type {ClientNetwork, ClientChan} from "../js/types"; import {useStore} from "../js/store"; +import {ChanType} from "../../shared/types/chan"; const formattingHotkeys = { "mod+k": "\x03", @@ -130,7 +131,7 @@ export default defineComponent({ }; const getInputPlaceholder = (channel: ClientChan) => { - if (channel.type === "channel" || channel.type === "query") { + if (channel.type === ChanType.CHANNEL || channel.type === ChanType.QUERY) { return `Write to ${channel.name}`; } diff --git a/client/components/MessageCondensed.vue b/client/components/MessageCondensed.vue index c45a7ac0d4..218fdeff38 100644 --- a/client/components/MessageCondensed.vue +++ b/client/components/MessageCondensed.vue @@ -20,6 +20,7 @@