From 8211893210812fe02d3a798df05f0434a54dd973 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Mon, 12 Dec 2022 19:27:47 +0900 Subject: [PATCH] Fix lint errors (except `@typescript-eslint/prefer-nullish-coalescing`) (#9311) * `yarn workspace client run lint --fix` * `eslint-disable-next-line no-var` for service worker self * A few more manual sw fixes * word change --- packages/client/src/components/MkCwButton.vue | 2 +- packages/client/src/nirax.ts | 2 +- packages/client/src/pages/settings/index.vue | 2 +- packages/client/src/pages/settings/theme.manage.vue | 2 +- packages/client/src/pages/settings/theme.vue | 4 ++-- packages/client/src/pages/user/index.activity.vue | 2 +- packages/client/src/scripts/theme-editor.ts | 6 +++--- packages/client/src/ui/deck/column.vue | 2 +- packages/client/src/ui/deck/notifications-column.vue | 2 +- packages/sw/src/scripts/create-notification.ts | 10 +++++++--- packages/sw/src/scripts/lang.ts | 2 -- packages/sw/src/scripts/notification-read.ts | 2 -- packages/sw/src/scripts/operations.ts | 3 +++ packages/sw/src/scripts/url.ts | 2 +- packages/sw/src/sw.ts | 3 ++- 15 files changed, 25 insertions(+), 21 deletions(-) diff --git a/packages/client/src/components/MkCwButton.vue b/packages/client/src/components/MkCwButton.vue index dd906f9bf3..a473d682a9 100644 --- a/packages/client/src/components/MkCwButton.vue +++ b/packages/client/src/components/MkCwButton.vue @@ -24,7 +24,7 @@ const emit = defineEmits<{ const label = computed(() => { return concat([ props.note.text ? [i18n.t('_cw.chars', { count: length(props.note.text) })] : [], - props.note.files && props.note.files.length !== 0 ? [i18n.t('_cw.files', { count: props.note.files.length }) ] : [], + props.note.files && props.note.files.length !== 0 ? [i18n.t('_cw.files', { count: props.note.files.length })] : [], props.note.poll != null ? [i18n.ts.poll] : [] ] as string[][]).join(' / '); }); diff --git a/packages/client/src/nirax.ts b/packages/client/src/nirax.ts index 0ee39bf473..53e73a8d48 100644 --- a/packages/client/src/nirax.ts +++ b/packages/client/src/nirax.ts @@ -105,7 +105,7 @@ export class Router extends EventEmitter<{ function check(routes: RouteDef[], _parts: string[]): Resolved | null { forEachRouteLoop: for (const route of routes) { - let parts = [ ..._parts ]; + let parts = [..._parts]; const props = new Map(); pathMatchLoop: diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 73407ff5fb..c38e1394f0 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -27,7 +27,7 @@ import { i18n } from '@/i18n'; import MkInfo from '@/components/MkInfo.vue'; import MkSuperMenu from '@/components/MkSuperMenu.vue'; import { scroll } from '@/scripts/scroll'; -import { signout , $i } from '@/account'; +import { signout, $i } from '@/account'; import { unisonReload } from '@/scripts/unison-reload'; import { instance } from '@/instance'; import { useRouter } from '@/router'; diff --git a/packages/client/src/pages/settings/theme.manage.vue b/packages/client/src/pages/settings/theme.manage.vue index 792bb15e5d..25f92e6ed1 100644 --- a/packages/client/src/pages/settings/theme.manage.vue +++ b/packages/client/src/pages/settings/theme.manage.vue @@ -43,7 +43,7 @@ const installedThemes = ref(getThemes()); const builtinThemes = getBuiltinThemesRef(); const selectedThemeId = ref(null); -const themes = computed(() => [ ...installedThemes.value, ...builtinThemes.value ]); +const themes = computed(() => [...installedThemes.value, ...builtinThemes.value]); const selectedTheme = computed(() => { if (selectedThemeId.value == null) return null; diff --git a/packages/client/src/pages/settings/theme.vue b/packages/client/src/pages/settings/theme.vue index 6571a881a9..42a91bcb59 100644 --- a/packages/client/src/pages/settings/theme.vue +++ b/packages/client/src/pages/settings/theme.vue @@ -76,7 +76,7 @@ import FormButton from '@/components/MkButton.vue'; import { getBuiltinThemesRef } from '@/scripts/theme'; import { selectFile } from '@/scripts/select-file'; import { isDeviceDarkmode } from '@/scripts/is-device-darkmode'; -import { ColdDeviceStorage , defaultStore } from '@/store'; +import { ColdDeviceStorage, defaultStore } from '@/store'; import { i18n } from '@/i18n'; import { instance } from '@/instance'; import { uniqueBy } from '@/scripts/array'; @@ -92,7 +92,7 @@ const builtinDarkThemes = computed(() => builtinThemes.value.filter(t => t.base const instanceLightTheme = computed(() => instance.defaultLightTheme ? JSON5.parse(instance.defaultLightTheme) : null); const installedLightThemes = computed(() => installedThemes.value.filter(t => t.base === 'light' || t.kind === 'light')); const builtinLightThemes = computed(() => builtinThemes.value.filter(t => t.base === 'light' || t.kind === 'light')); -const themes = computed(() => uniqueBy([ instanceDarkTheme.value, instanceLightTheme.value, ...builtinThemes.value, ...installedThemes.value ].filter(x => x != null), theme => theme.id)); +const themes = computed(() => uniqueBy([instanceDarkTheme.value, instanceLightTheme.value, ...builtinThemes.value, ...installedThemes.value].filter(x => x != null), theme => theme.id)); const darkTheme = ColdDeviceStorage.ref('darkTheme'); const darkThemeId = computed({ diff --git a/packages/client/src/pages/user/index.activity.vue b/packages/client/src/pages/user/index.activity.vue index 43c2ed8b04..630a2cea7d 100644 --- a/packages/client/src/pages/user/index.activity.vue +++ b/packages/client/src/pages/user/index.activity.vue @@ -37,7 +37,7 @@ function showMenu(ev: MouseEvent) { action: () => { chartSrc = 'per-user-notes'; }, - },/*, { + }, /*, { text: i18n.ts.following, action: () => { chartSrc = 'per-user-following'; diff --git a/packages/client/src/scripts/theme-editor.ts b/packages/client/src/scripts/theme-editor.ts index 2c917e280d..6d88d6856c 100644 --- a/packages/client/src/scripts/theme-editor.ts +++ b/packages/client/src/scripts/theme-editor.ts @@ -54,7 +54,7 @@ export const toThemeString = (value: Color | Func | RefProp | RefConst | Css) => export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: string, author: string, base: 'dark' | 'light'): Theme => { const props = { } as { [key: string]: string }; - for (const [ key, value ] of vm) { + for (const [key, value] of vm) { if (value === null) continue; props[key] = toThemeString(value); } @@ -68,13 +68,13 @@ export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: st export const convertToViewModel = (theme: Theme): ThemeViewModel => { const vm: ThemeViewModel = []; // プロパティの登録 - vm.push(...themeProps.map(key => [ key, fromThemeString(theme.props[key])] as [ string, ThemeValue ])); + vm.push(...themeProps.map(key => [key, fromThemeString(theme.props[key])] as [ string, ThemeValue ])); // 定数の登録 const consts = Object .keys(theme.props) .filter(k => k.startsWith('$')) - .map(k => [ k, fromThemeString(theme.props[k]) ] as [ string, ThemeValue ]); + .map(k => [k, fromThemeString(theme.props[k])] as [ string, ThemeValue ]); vm.push(...consts); return vm; diff --git a/packages/client/src/ui/deck/column.vue b/packages/client/src/ui/deck/column.vue index 7b30ffad45..d16c23d100 100644 --- a/packages/client/src/ui/deck/column.vue +++ b/packages/client/src/ui/deck/column.vue @@ -33,7 +33,7 @@