From 73e594a2f9d02835dd1b78412b28940e735e7328 Mon Sep 17 00:00:00 2001 From: n0099 Date: Fri, 15 Mar 2024 05:06:50 +0800 Subject: [PATCH] * move the type of prop `postTypeID` to generic `TPostIDKey` and rename it to `postIDKey` @ `badges/` * replace literal `string[]` of known post types with `postType@shared/index.ts` @ queryForm/queryParams.ts @ components/Post * add an option `always-multiline` for rule `vue/multiline-ternary` to sync with `@stylistic/multiline-ternary` since 9e39229785f5789ab459263cd084c2e73ef38685 @ .eslintrc.cjs @ fe --- fe/.eslintrc.cjs | 2 +- .../Post/badges/PostCommonMetadataIconLinks.vue | 13 ++++++++----- fe/src/components/Post/queryForm/queryParams.ts | 4 ++-- fe/src/components/Post/renderers/RendererTable.vue | 4 +--- fe/src/components/Post/renderers/list/ReplyItem.vue | 2 +- .../Post/renderers/list/SubReplyGroup.vue | 2 +- .../components/Post/renderers/list/ThreadItem.vue | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/fe/.eslintrc.cjs b/fe/.eslintrc.cjs index be5c5f9c..7757f695 100644 --- a/fe/.eslintrc.cjs +++ b/fe/.eslintrc.cjs @@ -510,7 +510,7 @@ const eslintPluginVue = { // as of eslint-plugin-vue@9.19.2 'vue/define-emits-declaration': ['error', 'type-literal'], 'vue/no-required-prop-with-default': 'error', 'vue/v-on-handler-style': ['error', 'inline-function'], - 'vue/multiline-ternary': 'error', + 'vue/multiline-ternary': ['error', 'always-multiline'], 'vue/array-element-newline': ['error', 'consistent'], 'vue/prefer-define-options': 'error', 'vue/valid-define-options': 'error', diff --git a/fe/src/components/Post/badges/PostCommonMetadataIconLinks.vue b/fe/src/components/Post/badges/PostCommonMetadataIconLinks.vue index ce9fbf76..e6835ebe 100644 --- a/fe/src/components/Post/badges/PostCommonMetadataIconLinks.vue +++ b/fe/src/components/Post/badges/PostCommonMetadataIconLinks.vue @@ -5,7 +5,7 @@ target="_blank" class="badge bg-light rounded-pill link-dark"> - ${postIDKey}:${props.post[props.postIDKey]}
首次收录时间:${formatTime(props.post.createdAt)}
最后更新时间:${formatTime(props.post.updatedAt ?? props.post.createdAt)}
最后发现时间:${formatTime(props.post.lastSeenAt ?? props.post.updatedAt ?? props.post.createdAt)}`" @@ -14,17 +14,20 @@
-