Skip to content

Commit 799addd

Browse files
committed
workflow: modify formatter rules
1 parent b267579 commit 799addd

File tree

2 files changed

+13
-29
lines changed

2 files changed

+13
-29
lines changed

rome.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
}
1010
}
1111
},
12+
"formatter": {
13+
"lineWidth": 120
14+
},
1215
"javascript": {
1316
"formatter": {
1417
"quoteStyle": "single",

src/Component.ts

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,7 @@ import { globalAttrs, globalProps } from './install'
33
import { debounce } from 'lodash-es'
44
import { JSONEditor } from 'vanilla-jsoneditor'
55
import type { Content, JSONContent, TextContent } from 'vanilla-jsoneditor'
6-
import {
7-
defineComponent,
8-
getCurrentInstance,
9-
h,
10-
isVue3,
11-
onMounted,
12-
onUnmounted,
13-
ref,
14-
unref,
15-
watch,
16-
} from 'vue-demi'
6+
import { defineComponent, getCurrentInstance, h, isVue3, onMounted, onUnmounted, ref, unref, watch } from 'vue-demi'
177
import type { PropType } from 'vue-demi'
188
import { conclude } from 'vue-global-config'
199

@@ -74,15 +64,11 @@ export default defineComponent({
7464
const initialMode = conclude([props.mode, globalProps.mode], {
7565
type: String as PropType<Mode>,
7666
})
77-
const initialValue = conclude([
78-
props[modelValueProp],
79-
globalProps[modelValueProp],
80-
])
67+
const initialValue = conclude([props[modelValueProp], globalProps[modelValueProp]])
8168
const initialBoolAttrs = Object.fromEntries(
82-
Array.from(boolAttrs, (boolAttr) => [
83-
boolAttr,
84-
conclude([props[boolAttr], globalProps[boolAttr]]),
85-
]).filter(([, v]) => v !== undefined),
69+
Array.from(boolAttrs, (boolAttr) => [boolAttr, conclude([props[boolAttr], globalProps[boolAttr]])]).filter(
70+
([, v]) => v !== undefined,
71+
),
8672
)
8773

8874
const onChange = debounce((updatedContent: Content) => {
@@ -103,11 +89,10 @@ export default defineComponent({
10389
emit('update:mode', mode)
10490
}
10591

106-
const mergeFunction =
107-
(previousValue: Function, currentValue: Function) => (...args: any) => {
108-
previousValue(...args)
109-
currentValue(...args)
110-
}
92+
const mergeFunction = (previousValue: Function, currentValue: Function) => (...args: any) => {
93+
previousValue(...args)
94+
currentValue(...args)
95+
}
11196

11297
const initialAttrs = conclude(
11398
[
@@ -168,11 +153,7 @@ export default defineComponent({
168153
() => Array.from(boolAttrs, (boolAttr) => props[boolAttr]),
169154
(values) => {
170155
jsonEditor.value.updateProps(
171-
Object.fromEntries(
172-
Array.from(values, (v, i) => [boolAttrs[i], v]).filter(
173-
([, v]) => v !== undefined,
174-
),
175-
),
156+
Object.fromEntries(Array.from(values, (v, i) => [boolAttrs[i], v]).filter(([, v]) => v !== undefined)),
176157
)
177158
},
178159
)

0 commit comments

Comments
 (0)