From a32f911ab900abbb58a2ebda6f44c536ca125465 Mon Sep 17 00:00:00 2001 From: Shyam-Chen Date: Fri, 10 May 2024 17:13:47 +0800 Subject: [PATCH] 1,455th Commit --- .eslintrc | 38 +++++++++-------- .../(library)/data-display/tree/Basic.vue | 6 +-- .../data-display/tree/Controlled.vue | 4 +- .../(library)/data-display/tree/Lazy.vue | 3 +- .../data-display/tree/MultipleSelection.vue | 4 +- .../(library)/navigation/tabs/+page.vue | 2 +- .../(library)/navigation/tours/+page.vue | 8 ++-- .../(library)/network/fetch/+page.vue | 2 +- package.json | 1 + .../components/autocomplete/Autocomplete.vue | 41 +++++++++++++------ ui/src/components/highlight/Highlight.vue | 4 +- .../multiautocomplete/Multiautocomplete.vue | 2 +- ui/src/components/popover/Popover.vue | 6 ++- .../components/range-slider/RangeSlider.vue | 13 +++--- ui/src/components/select/Select.vue | 34 +++++++++------ .../select/__tests__/Select.spec.ts | 2 +- ui/src/components/spinner/Spinner.vue | 4 +- ui/src/components/time-picker/TimePicker.vue | 26 ++++++------ ui/src/components/tooltip/Tooltip.vue | 28 +++++++------ ui/src/components/tour/Tour.vue | 38 ++++++++++------- ui/src/components/week-picker/WeekPicker.vue | 26 ++++++------ ui/src/components/year-picker/YearPicker.vue | 26 ++++++------ 22 files changed, 185 insertions(+), 133 deletions(-) diff --git a/.eslintrc b/.eslintrc index ecbcce37..039781b9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,24 +7,16 @@ ], "rules": { "vue/multi-word-component-names": "off", - "vue/attribute-hyphenation": "off", - "vue/v-on-event-hyphenation": "off", + "vue/attribute-hyphenation": ["error", "never"], + "vue/v-on-event-hyphenation": ["error", "never"], + "vue/no-v-html": "off", "vue/block-lang": ["error", { "script": { "lang": "ts" } }], "vue/block-order": ["error", { "order": ["script[setup]", "template", "style[scoped]"] }], - "vue/block-tag-newline": [ - "error", - { "singleline": "always", "multiline": "always", "maxEmptyLines": 1 } - ], "vue/component-api-style": ["error", ["script-setup"]], - "vue/component-name-in-template-casing": [ - "error", - "PascalCase", - { "registeredComponentsOnly": true } - ], - "vue/component-options-name-casing": ["error", "PascalCase"], - "vue/custom-event-name-casing": ["error", "camelCase"], - "vue/define-emits-declaration": ["error", "type-based"], + "vue/component-name-in-template-casing": "error", + "vue/custom-event-name-casing": "error", + "vue/define-emits-declaration": "error", "vue/define-macros-order": [ "error", { @@ -32,7 +24,21 @@ "defineExposeLast": true } ], - "vue/define-props-declaration": ["error", "type-based"], - "vue/html-button-has-type": ["error", { "button": true, "submit": true, "reset": true }] + "vue/define-props-declaration": "error", + "vue/html-button-has-type": "error", + "vue/no-multiple-objects-in-class": "warn", + "vue/no-restricted-call-after-await": "error", + "vue/no-template-target-blank": "error", + "vue/no-unused-refs": "warn", + "vue/no-use-v-else-with-v-for": "error", + "vue/no-v-text": "error", + "vue/padding-line-between-blocks": "warn", + "vue/prefer-define-options": "error", + "vue/prefer-separate-static-class": "error", + "vue/prefer-true-attribute-shorthand": "warn", + "vue/require-macro-variable-name": "error", + "vue/require-typed-ref": "warn", + "vue/v-for-delimiter-style": "error", + "vue/valid-define-options": "error" } } diff --git a/app/src/routes/(backstage)/(library)/data-display/tree/Basic.vue b/app/src/routes/(backstage)/(library)/data-display/tree/Basic.vue index c38c9eff..9aa8d845 100644 --- a/app/src/routes/(backstage)/(library)/data-display/tree/Basic.vue +++ b/app/src/routes/(backstage)/(library)/data-display/tree/Basic.vue @@ -4,7 +4,7 @@ import { XTree } from '@x/ui'; import nodesData from './nodesData'; -const nodes = ref(); +const nodes = ref(); onMounted(() => { nodes.value = structuredClone(nodesData); @@ -12,10 +12,10 @@ onMounted(() => { type XTreeProps = InstanceType; -const selected = ref(); +const selected = ref(''); const nodeSelect: XTreeProps['onSelect'] = (node) => { - selected.value = node.value; + selected.value = node.value as string; }; diff --git a/app/src/routes/(backstage)/(library)/data-display/tree/Controlled.vue b/app/src/routes/(backstage)/(library)/data-display/tree/Controlled.vue index 117acc0e..775888ce 100644 --- a/app/src/routes/(backstage)/(library)/data-display/tree/Controlled.vue +++ b/app/src/routes/(backstage)/(library)/data-display/tree/Controlled.vue @@ -6,8 +6,8 @@ import { XTree, XButton } from '@x/ui'; import nodesData from './nodesData'; const tree = ref>(); -const selected = ref(); -const nodes = ref(); +const selected = ref(''); +const nodes = ref(); onMounted(() => { nodes.value = structuredClone(nodesData); diff --git a/app/src/routes/(backstage)/(library)/data-display/tree/Lazy.vue b/app/src/routes/(backstage)/(library)/data-display/tree/Lazy.vue index 2b9ab05d..8275670e 100644 --- a/app/src/routes/(backstage)/(library)/data-display/tree/Lazy.vue +++ b/app/src/routes/(backstage)/(library)/data-display/tree/Lazy.vue @@ -1,8 +1,9 @@