diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2025-02-05 19:01:44 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-05 10:01:44 +0000 |
| commit | c548ec9906947c72743e611254a6557e8e8d057c (patch) | |
| tree | 18a7ed26909bf9a3b788be38cb7e756dca6f4134 /packages/frontend/src/scripts | |
| parent | [skip ci] Update CHANGELOG.md (prepend template) (diff) | |
| download | sharkey-c548ec9906947c72743e611254a6557e8e8d057c.tar.gz sharkey-c548ec9906947c72743e611254a6557e8e8d057c.tar.bz2 sharkey-c548ec9906947c72743e611254a6557e8e8d057c.zip | |
refactor(frontend): verbatimModuleSyntaxを有効化 (#15323)
* wip
* wip
* wip
* wip
* revert unnecessary changes
* wip
* refactor(frontend): enforce verbatimModuleSyntax
* fix
* refactor(frontend-shared): enforce verbatimModuleSyntax
* wip
* refactor(frontend-embed): enforce verbatimModuleSyntax
* enforce consistent-type-imports
* fix lint config
* attemt to fix ci
* fix lint
* fix
* fix
* fix
Diffstat (limited to 'packages/frontend/src/scripts')
18 files changed, 31 insertions, 18 deletions
diff --git a/packages/frontend/src/scripts/aiscript/common.ts b/packages/frontend/src/scripts/aiscript/common.ts index de6fa1d633..ba5dfb8368 100644 --- a/packages/frontend/src/scripts/aiscript/common.ts +++ b/packages/frontend/src/scripts/aiscript/common.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { errors, utils, type values } from '@syuilo/aiscript'; +import { errors, utils } from '@syuilo/aiscript'; +import type { values } from '@syuilo/aiscript'; export function assertStringAndIsIn<A extends readonly string[]>(value: values.Value | undefined, expects: A): asserts value is values.VStr & { value: A[number] } { utils.assertString(value); diff --git a/packages/frontend/src/scripts/aiscript/ui.ts b/packages/frontend/src/scripts/aiscript/ui.ts index ca92b27ff5..46e193f7c1 100644 --- a/packages/frontend/src/scripts/aiscript/ui.ts +++ b/packages/frontend/src/scripts/aiscript/ui.ts @@ -5,7 +5,8 @@ import { utils, values } from '@syuilo/aiscript'; import { v4 as uuid } from 'uuid'; -import { ref, Ref } from 'vue'; +import { ref } from 'vue'; +import type { Ref } from 'vue'; import * as Misskey from 'misskey-js'; import { assertStringAndIsIn } from './common.js'; diff --git a/packages/frontend/src/scripts/autocomplete.ts b/packages/frontend/src/scripts/autocomplete.ts index 7766c44c04..55015c90fd 100644 --- a/packages/frontend/src/scripts/autocomplete.ts +++ b/packages/frontend/src/scripts/autocomplete.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { nextTick, Ref, ref, defineAsyncComponent } from 'vue'; +import { nextTick, ref, defineAsyncComponent } from 'vue'; +import type { Ref } from 'vue'; import getCaretCoordinates from 'textarea-caret'; import { toASCII } from 'punycode.js'; import { popup } from '@/os.js'; diff --git a/packages/frontend/src/scripts/chart-legend.ts b/packages/frontend/src/scripts/chart-legend.ts index 2d534f60c1..e701d18dd2 100644 --- a/packages/frontend/src/scripts/chart-legend.ts +++ b/packages/frontend/src/scripts/chart-legend.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Plugin } from 'chart.js'; +import type { Plugin } from 'chart.js'; import MkChartLegend from '@/components/MkChartLegend.vue'; export const chartLegend = (legend: InstanceType<typeof MkChartLegend>) => ({ diff --git a/packages/frontend/src/scripts/chart-vline.ts b/packages/frontend/src/scripts/chart-vline.ts index 24e41245e7..465ca591c6 100644 --- a/packages/frontend/src/scripts/chart-vline.ts +++ b/packages/frontend/src/scripts/chart-vline.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Plugin } from 'chart.js'; +import type { Plugin } from 'chart.js'; export const chartVLine = (vLineColor: string) => ({ id: 'vLine', diff --git a/packages/frontend/src/scripts/check-reaction-permissions.ts b/packages/frontend/src/scripts/check-reaction-permissions.ts index c3c3f419a9..281ea2520e 100644 --- a/packages/frontend/src/scripts/check-reaction-permissions.ts +++ b/packages/frontend/src/scripts/check-reaction-permissions.ts @@ -4,7 +4,7 @@ */ import * as Misskey from 'misskey-js'; -import { UnicodeEmojiDef } from '@@/js/emojilist.js'; +import type { UnicodeEmojiDef } from '@@/js/emojilist.js'; export function checkReactionPermissions(me: Misskey.entities.MeDetailed, note: Misskey.entities.Note, emoji: Misskey.entities.EmojiSimple | UnicodeEmojiDef | string): boolean { if (typeof emoji === 'string') return true; // UnicodeEmojiDefにも無い絵文字であれば文字列で来る。Unicode絵文字であることには変わりないので常にリアクション可能とする; diff --git a/packages/frontend/src/scripts/emoji-picker.ts b/packages/frontend/src/scripts/emoji-picker.ts index 14b5cbf35e..e704b5fd6f 100644 --- a/packages/frontend/src/scripts/emoji-picker.ts +++ b/packages/frontend/src/scripts/emoji-picker.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { defineAsyncComponent, Ref, ref } from 'vue'; +import { defineAsyncComponent, ref } from 'vue'; +import type { Ref } from 'vue'; import { popup } from '@/os.js'; import { defaultStore } from '@/store.js'; diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index bc504077b0..23fe811525 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { defineAsyncComponent, Ref, ShallowRef } from 'vue'; +import { defineAsyncComponent } from 'vue'; +import type { Ref, ShallowRef } from 'vue'; import * as Misskey from 'misskey-js'; import { url } from '@@/js/config.js'; import { claimAchievement } from './achievements.js'; diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts index 94a1d4c855..8f7c3ba3be 100644 --- a/packages/frontend/src/scripts/get-user-menu.ts +++ b/packages/frontend/src/scripts/get-user-menu.ts @@ -14,7 +14,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js'; import { defaultStore, userActions } from '@/store.js'; import { $i, iAmModerator } from '@/account.js'; import { notesSearchAvailable, canSearchNonLocalNotes } from '@/scripts/check-permissions.js'; -import { IRouter } from '@/nirax.js'; +import type { IRouter } from '@/nirax.js'; import { antennasCache, rolesCache, userListsCache } from '@/cache.js'; import { mainRouter } from '@/router/main.js'; import { genEmbedCode } from '@/scripts/get-embed-code.js'; diff --git a/packages/frontend/src/scripts/install-theme.ts b/packages/frontend/src/scripts/install-theme.ts index 866f1225bf..cc32adcc6a 100644 --- a/packages/frontend/src/scripts/install-theme.ts +++ b/packages/frontend/src/scripts/install-theme.ts @@ -5,7 +5,8 @@ import JSON5 from 'json5'; import { addTheme, getThemes } from '@/theme-store.js'; -import { Theme, applyTheme, validateTheme } from '@/scripts/theme.js'; +import { applyTheme, validateTheme } from '@/scripts/theme.js'; +import type { Theme } from '@/scripts/theme.js'; export function parseThemeCode(code: string): Theme { let theme; diff --git a/packages/frontend/src/scripts/mfm-function-picker.ts b/packages/frontend/src/scripts/mfm-function-picker.ts index bf59fe98a0..a2f777f623 100644 --- a/packages/frontend/src/scripts/mfm-function-picker.ts +++ b/packages/frontend/src/scripts/mfm-function-picker.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Ref, nextTick } from 'vue'; +import { nextTick } from 'vue'; +import type { Ref } from 'vue'; import * as os from '@/os.js'; import { i18n } from '@/i18n.js'; import { MFM_TAGS } from '@@/js/const.js'; diff --git a/packages/frontend/src/scripts/page-metadata.ts b/packages/frontend/src/scripts/page-metadata.ts index 0e3b093ecf..671751147c 100644 --- a/packages/frontend/src/scripts/page-metadata.ts +++ b/packages/frontend/src/scripts/page-metadata.ts @@ -4,7 +4,8 @@ */ import * as Misskey from 'misskey-js'; -import { MaybeRefOrGetter, Ref, inject, isRef, onActivated, onBeforeUnmount, provide, ref, toValue, watch } from 'vue'; +import { inject, isRef, onActivated, onBeforeUnmount, provide, ref, toValue, watch } from 'vue'; +import type { MaybeRefOrGetter, Ref } from 'vue'; export type PageMetadata = { title: string; diff --git a/packages/frontend/src/scripts/reaction-picker.ts b/packages/frontend/src/scripts/reaction-picker.ts index 7aec05c0cf..c142b3ed2a 100644 --- a/packages/frontend/src/scripts/reaction-picker.ts +++ b/packages/frontend/src/scripts/reaction-picker.ts @@ -4,7 +4,8 @@ */ import * as Misskey from 'misskey-js'; -import { defineAsyncComponent, Ref, ref } from 'vue'; +import { defineAsyncComponent, ref } from 'vue'; +import type { Ref } from 'vue'; import { popup } from '@/os.js'; import { defaultStore } from '@/store.js'; diff --git a/packages/frontend/src/scripts/theme-editor.ts b/packages/frontend/src/scripts/theme-editor.ts index 0092af1640..0206e378bf 100644 --- a/packages/frontend/src/scripts/theme-editor.ts +++ b/packages/frontend/src/scripts/theme-editor.ts @@ -5,7 +5,8 @@ import { v4 as uuid } from 'uuid'; -import { themeProps, Theme } from './theme.js'; +import { themeProps } from './theme.js'; +import type { Theme } from './theme.js'; export type Default = null; export type Color = string; diff --git a/packages/frontend/src/scripts/use-form.ts b/packages/frontend/src/scripts/use-form.ts index 0d505fe466..26cca839c3 100644 --- a/packages/frontend/src/scripts/use-form.ts +++ b/packages/frontend/src/scripts/use-form.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { computed, Reactive, reactive, watch } from 'vue'; +import { computed, reactive, watch } from 'vue'; +import type { Reactive } from 'vue'; function copy<T>(v: T): T { return JSON.parse(JSON.stringify(v)); diff --git a/packages/frontend/src/scripts/use-leave-guard.ts b/packages/frontend/src/scripts/use-leave-guard.ts index 5f7e56e8a9..395c12a756 100644 --- a/packages/frontend/src/scripts/use-leave-guard.ts +++ b/packages/frontend/src/scripts/use-leave-guard.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Ref } from 'vue'; +import type { Ref } from 'vue'; export function useLeaveGuard(enabled: Ref<boolean>) { /* TODO diff --git a/packages/frontend/src/scripts/use-note-capture.ts b/packages/frontend/src/scripts/use-note-capture.ts index 542d8ab52b..0bc10e90e4 100644 --- a/packages/frontend/src/scripts/use-note-capture.ts +++ b/packages/frontend/src/scripts/use-note-capture.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { onUnmounted, Ref, ShallowRef } from 'vue'; +import { onUnmounted } from 'vue'; +import type { Ref, ShallowRef } from 'vue'; import * as Misskey from 'misskey-js'; import { useStream } from '@/stream.js'; import { $i } from '@/account.js'; diff --git a/packages/frontend/src/scripts/use-tooltip.ts b/packages/frontend/src/scripts/use-tooltip.ts index a26d08cce7..d9ddfc8b5d 100644 --- a/packages/frontend/src/scripts/use-tooltip.ts +++ b/packages/frontend/src/scripts/use-tooltip.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Ref, ref, watch, onUnmounted } from 'vue'; +import { ref, watch, onUnmounted } from 'vue'; +import type { Ref } from 'vue'; export function useTooltip( elRef: Ref<HTMLElement | { $el: HTMLElement } | null | undefined>, |