Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update eslint ecosystem to eslint v9 #19

Merged
merged 5 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ a {
color: #36ad6a;
}
code, kbd, pre, samp {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
Liberation Mono, Courier New, monospace;
}
</style>
7 changes: 6 additions & 1 deletion app/components/changelog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ const { t } = useI18n({ useScope: 'local' });
<template>
<NAlert v-if="__CANARY__" type="info">
<I18nT keypath="canary-tip">
<a :href="`${GITHUB_REPO_URL}/blob/main/CHANGELOG.md`" target="_blank">GitHub</a>
<a
:href="`${GITHUB_REPO_URL}/blob/main/CHANGELOG.md`"
target="_blank"
>
GitHub
</a>
</I18nT>
<br>
{{ t('build-time') }}
Expand Down
4 changes: 3 additions & 1 deletion app/components/ex-caller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ function handlePaused() {
const loadSettings = ref(false); // 是否需要加载设置组件
const loadedSettings = ref(false); // 设置组件是否已经加载完成
const showSettings = ref(false);
const showLoadingSettings = computed(() => showSettings.value && !loadedSettings.value);
const showLoadingSettings = computed(
() => showSettings.value && !loadedSettings.value,
);

function handleOpenSettings() {
if (showSettings.value)
Expand Down
6 changes: 5 additions & 1 deletion app/components/result-board.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ function handlePause() {
@click="handlePause"
>
<NSpace v-if="value === undefined">
<LargeButton type="primary" data-guide-id="start-button" @click.stop="$emit('start')">
<LargeButton
type="primary"
data-guide-id="start-button"
@click.stop="$emit('start')"
>
<template #icon>
<NIcon class="ml-1" :size="36">
<IconStart />
Expand Down
4 changes: 3 additions & 1 deletion app/components/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ en:
theme: Theme
plan: Plans
canary:
alert: You are using the Canary version, which is unstable. If you encounter any problems, please {1}.
alert:
You are using the Canary version,
which is unstable. If you encounter any problems, please {1}.
feedback: submit feedback

zh-CN:
Expand Down
10 changes: 8 additions & 2 deletions app/components/settings/entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ const supported = computed(() => {
>
<slot name="icon" />
<span class="ml-1">{{ title }}</span>
<LucideArrowRight v-if="supported" class="absolute right-3" :size="20" />
<LucideArrowRight
v-if="supported"
class="absolute right-3"
:size="20"
/>
</NCard>
</template>
</NTooltip>
Expand Down Expand Up @@ -79,7 +83,9 @@ const supported = computed(() => {

<i18n lang="yaml">
en:
unsupported: Due to technical limitations, please download the App to experience this feature
unsupported:
Due to technical limitations,
please download the App to experience this feature

zh-CN:
unsupported: 由于技术限制,请下载 App 体验此功能
Expand Down
44 changes: 35 additions & 9 deletions app/components/settings/footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ function checkUpdate() {

<template>
<div class="flex items-center">
<LinkToModal :modal-title="t('3rd-party-licenses-title')" @click="loadLicenses = true">
<LinkToModal
:modal-title="t('3rd-party-licenses-title')"
@click="loadLicenses = true"
>
{{ t('3rd-party-licenses') }}
<template #modalContent>
<LazyLicenses v-if="loadLicenses" />
Expand All @@ -43,7 +46,10 @@ function checkUpdate() {

<NDivider vertical />

<LinkToModal :modal-title="t('changelog-title')" @click="loadChangelog = true">
<LinkToModal
:modal-title="t('changelog-title')"
@click="loadChangelog = true"
>
{{ t('changelog') }}
<template #modalContent>
<LazyChangelog v-if="loadChangelog" />
Expand All @@ -52,7 +58,10 @@ function checkUpdate() {

<NDivider vertical />

<LinkToModal v-model:show-modal="showFeedback" :modal-title="t('feedback.title')">
<LinkToModal
v-model:show-modal="showFeedback"
:modal-title="t('feedback.title')"
>
{{ t('feedback.title') }}
<template #modalContent>
<p class="mt-0">
Expand Down Expand Up @@ -89,7 +98,12 @@ function checkUpdate() {

<NDivider v-if="__APP__" vertical />

<NButton v-if="__APP__" text :loading="checkingUpdate" @click="checkUpdate">
<NButton
v-if="__APP__"
text
:loading="checkingUpdate"
@click="checkUpdate"
>
{{ checkingUpdate ? '' : t('check-update') }}
</NButton>
</div>
Expand All @@ -98,7 +112,11 @@ function checkUpdate() {
ExCaller {{ VERSION }}
<img class="inline w-4 mx-2 select-none" src="/logo.webp">
Made by
<a class="inline-flex mx-1 select-none" href="https://www.typed-sigterm.me/" target="_blank">
<a
class="inline-flex mx-1 select-none"
href="https://www.typed-sigterm.me/"
target="_blank"
>
<img class="w-3.5" :src="avatarTypedSigterm" alt="Typed SIGTERM">
</a>
, and
Expand Down Expand Up @@ -127,15 +145,23 @@ en:
check-update: Check Update
feedback:
title: Send Feedback
desc: If you have any problems or suggestions while using ExCaller, feel free to send feedback to us.
desc:
If you have any problems or suggestions while using ExCaller,
feel free to send feedback to us.
ways: 'You can send feedback through either of the following ways:'
github: Create an issue on GitHub
email: Send an email to
email-subject:
before: Please include
after: in the email subject, otherwise the feedback may not be processed in time.
canary: If the problem only occurs in the Canary version, please indicate in the feedback.
thanks: After receiving the feedback, we will process it as soon as possible. Thank you for your support.
after:
in the email subject,
otherwise the feedback may not be processed in time.
canary:
If the problem only occurs in the Canary version,
please indicate in the feedback.
thanks:
After receiving the feedback, we will process it as soon as possible.
Thank you for your support.

zh-CN:
3rd-party-licenses: 开放源代码许可
Expand Down
4 changes: 3 additions & 1 deletion app/components/settings/group/batch-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ function handleOk() {
<i18n lang="yaml">
en:
title: Batch Input
tip: One name per line, automatically remove leading and trailing spaces and empty lines.
tip:
One name per line,
automatically remove leading and trailing spaces and empty lines.
confirm: Confirm & Add namelist

zh-CN:
Expand Down
11 changes: 8 additions & 3 deletions app/components/settings/group/operations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const { t } = useI18n({ useScope: 'local' });
const currentGroup = useConfigStore().group;
const names = defineModel<RollCallOption[]>('names', { required: true });

const limited = computed(() => useGroupStore().nameList.length >= MAX_GROUP_COUNT);
const limited = computed(
() => useGroupStore().nameList.length >= MAX_GROUP_COUNT,
);

const showBatchInput = ref(false);

Expand Down Expand Up @@ -71,8 +73,11 @@ en:
batch-input: Batch Input
import-excel: Import .xlsx
export: Export
batch-input-desc: One name per line, automatically remove leading and trailing spaces and empty lines.
reached-limit: The number of names has reached the limit and new names cannot be imported
batch-input-desc:
One name per line,
automatically remove leading and trailing spaces and empty lines.
reached-limit:
The number of names has reached the limit and new names cannot be imported

zh-CN:
batch-input: 批量输入
Expand Down
6 changes: 5 additions & 1 deletion app/components/settings/plan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ onBeforeUnmount(() => { // 保存设置
</script>

<template>
<NFormItem :label="t('enable-plan')" label-placement="left" data-guide-id="enable-plan-field">
<NFormItem
:label="t('enable-plan')"
label-placement="left"
data-guide-id="enable-plan-field"
>
<NSwitch v-model:value="config.plan.enabled" />
</NFormItem>

Expand Down
3 changes: 2 additions & 1 deletion app/components/settings/theme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const { t } = useI18n({ useScope: 'local' });

const theme = useThemeStore();

function getResource(name: ResourceName, filename?: string): UploadFileInfo | undefined {
function getResource(name: ResourceName, filename?: string):
UploadFileInfo | undefined {
const resource = theme[name];
if (!resource)
return;
Expand Down
3 changes: 2 additions & 1 deletion app/components/updater.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ async function checkUpdate() {
}
bus.on('check-update', checkUpdate);

const downloadStatus = ref<'idle' | 'downloading' | 'installing' | 'failed'>('idle');
const downloadStatus
= ref<'idle' | 'downloading' | 'installing' | 'failed'>('idle');
const downloadedSize = ref(Number.NaN);
const artifactSize = ref(Number.NaN);

Expand Down
6 changes: 5 additions & 1 deletion app/composables/use-json-file.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import type { BaseDirectory } from '@tauri-apps/plugin-fs';
import { exists, readTextFile, writeTextFile } from '@tauri-apps/plugin-fs';

export default async <T = any>(initial: T, path: string, baseDir: BaseDirectory) => {
export default async <T = any>(
initial: T,
path: string,
baseDir: BaseDirectory,
) => {
const ret = ref(initial);
const write = (content: any) => {
return writeTextFile(path, JSON.stringify(content), { baseDir });
Expand Down
10 changes: 9 additions & 1 deletion app/composables/use-roll-call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ export default (config: RollCallConfig): Ref<RollCallController> => {
currentValue.value = currentIndex.value = undefined;
};

return ref({ currentValue, currentIndex, next, pause, start, isActive, reset });
return ref({
currentValue,
currentIndex,
next,
pause,
start,
isActive,
reset,
});
};

export function rollCallOptionToString(option: RollCallOption) {
Expand Down
26 changes: 18 additions & 8 deletions app/error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const showClearConfig = ref(false);
const clearingConfig = ref(false);
async function handleClearConfig() {
clearingConfig.value = true;
if (!await saveFile('ex-caller.config.json', JSON.stringify(localStorage))) { // 用户取消
if (await saveFile('ex-caller.config.json', JSON.stringify(localStorage))) {
localStorage.clear();
location.reload();
} else { // 用户取消
clearingConfig.value = false;
return;
}
localStorage.clear();
location.reload();
}
</script>

Expand All @@ -39,7 +39,11 @@ async function handleClearConfig() {
{{ t('reset-config.download-backup-tip') }}
</NP>
<template #action>
<NButton type="error" :loading="clearingConfig" @click="handleClearConfig">
<NButton
type="error"
:loading="clearingConfig"
@click="handleClearConfig"
>
{{ t('reset-config.confirm') }}
</NButton>
<NButton :disabled="clearingConfig" @click="showClearConfig = false">
Expand Down Expand Up @@ -81,9 +85,15 @@ en:
reset-config:
button: Reset Config
confirm: Confirm Reset
desc: This operation will clear all local configurations, which can solve most problems.
consequence: However, this operation is destructive, and your data will be LOST and CANNOT be recovered if no backup.
download-backup-tip: If you click "Confirm Reset", ExCaller will export your configuration file for manual data recovery.
desc:
This operation will clear all local configurations,
which can solve most problems.
consequence:
However, this operation is destructive,
and your data will be LOST and CANNOT be recovered if no backup.
download-backup-tip:
If you click "Confirm Reset",
ExCaller will export your configuration file for manual data recovery.
cancel: Cancel

zh-CN:
Expand Down
3 changes: 2 additions & 1 deletion app/stores/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const useConfigStore = defineStore('config', {
state: () => {
const ret = useLocalStorage<UserConfig>('config', UserConfigSchema.parse({}));
const ret
= useLocalStorage<UserConfig>('config', UserConfigSchema.parse({}));
ret.value = UserConfigSchema.parse(ret.value);
fixGroup(ret.value.group);
return ret;
Expand Down
17 changes: 13 additions & 4 deletions app/stores/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export const useThemeStore = defineStore('theme', {
await tryMkdirRecursive('theme', BaseDirectory.AppData);

// store 内修改同步到本地文件
const localProps = await useJsonFile(this.properties, 'theme/properties.json', BaseDirectory.AppData);
const localProps = await useJsonFile(
this.properties,
'theme/properties.json',
BaseDirectory.AppData,
);
this.properties = localProps.value;
watchDeep(() => this.properties, v => localProps.value = v);

Expand Down Expand Up @@ -54,12 +58,17 @@ export const useThemeStore = defineStore('theme', {
const old = this[name];
if (old) {
old.revoke();
await old.rm().catch(() => 0); // 删除文件,忽略失败
await old.rm().catch(() => {}); // 删除文件,忽略失败
}

// 加载新资源
if (data)
await writeFile(`theme/${name}`, data, { baseDir: BaseDirectory.AppData });
if (data) {
await writeFile(
`theme/${name}`,
data,
{ baseDir: BaseDirectory.AppData },
);
}
await this.refresh([name]);
},
},
Expand Down
12 changes: 9 additions & 3 deletions app/utils/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { reactive } from 'vue';
import type { DialogApiInjection } from 'naive-ui/es/dialog/src/DialogProvider';
import type { MessageApiInjection } from 'naive-ui/es/message/src/MessageProvider';
import type {
DialogApiInjection,
} from 'naive-ui/es/dialog/src/DialogProvider';
import type {
MessageApiInjection,
} from 'naive-ui/es/message/src/MessageProvider';
import { isTauri } from '@tauri-apps/api/core';
import { version } from '~~/package.json';

Expand Down Expand Up @@ -45,7 +49,9 @@ export function alertError(content: unknown) {
});
}

export const createNotInAppError = () => createError('Please download the app to experience this feature.');
export function createNotInAppError() {
return createError('Please download the app to experience this feature.');
}

export const DEFAULT_LANG = 'en';

Expand Down
Loading