Skip to content

Commit 854a606

Browse files
committed
chore: eslint
1 parent 8ce9a45 commit 854a606

24 files changed

+1509
-1055
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 21 deletions
This file was deleted.

commitlint.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module.exports = {
2-
extends: [
3-
'@commitlint/config-conventional',
4-
],
2+
extends: ['@commitlint/config-conventional'],
53
}

entry.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import './src/vue-scroll-picker.css'
22
import VueScrollPicker from './src'
33

4-
54
export * from './src'
65
export default VueScrollPicker

eslint.config.mjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
2+
import eslintPluginVue from 'eslint-plugin-vue'
3+
import {
4+
defineConfigWithVueTs,
5+
vueTsConfigs,
6+
} from '@vue/eslint-config-typescript'
7+
8+
export default defineConfigWithVueTs(
9+
{
10+
ignores: ['example-dist/*'],
11+
},
12+
eslintPluginVue.configs['flat/recommended'],
13+
vueTsConfigs.recommended,
14+
eslintPluginPrettierRecommended,
15+
{
16+
rules: {
17+
'no-console': 'error',
18+
},
19+
},
20+
)

example/Example.vue

Lines changed: 90 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,127 @@
33
<div>
44
<div class="hero">
55
<h2>Vue Scroll Picker</h2>
6-
<p>iOS Style Scroll Picker Component for Vue 3. Support All Gestures of Mouse(also MouseWheel) and Touch.</p>
7-
<a class="github" href="https://github.com/wan2land/vue-scroll-picker" target="_blank" v-html="iconGithub" />
6+
<p>
7+
iOS Style Scroll Picker Component for Vue 3. Support All Gestures of
8+
Mouse(also MouseWheel) and Touch.
9+
</p>
10+
<a
11+
class="github"
12+
href="https://github.com/wan2land/vue-scroll-picker"
13+
target="_blank"
14+
v-html="iconGithub"
15+
/>
816
</div>
917
<div class="section">
1018
<div class="container">
1119
<h2 id="full_binding"><a href="#full_binding">Full Binding</a></h2>
12-
<p>Vue Scroll Picker provides full data binding. <a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleDynamicOptions.vue">[Source]</a></p>
20+
<p>
21+
Vue Scroll Picker provides full data binding.
22+
<a
23+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleDynamicOptions.vue"
24+
>[Source]</a
25+
>
26+
</p>
1327
<ExampleFullBinding :options="defaultOptions" />
1428

15-
<h2 id="disabled_items"><a href="#disabled_items">Disabled Items</a></h2>
16-
<p>You can add a disabled property to the select options. A disabled value cannot be selected. <a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleDisabledItems.vue">[Source]</a></p>
29+
<h2 id="disabled_items">
30+
<a href="#disabled_items">Disabled Items</a>
31+
</h2>
32+
<p>
33+
You can add a disabled property to the select options. A disabled
34+
value cannot be selected.
35+
<a
36+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleDisabledItems.vue"
37+
>[Source]</a
38+
>
39+
</p>
1740
<ExampleDisabledItems />
1841

1942
<h2 id="placeholder"><a href="#placeholder">Placeholder</a></h2>
20-
<p>Vue Scroll Picker provides a placeholder option. When setting a placeholder, you can use null as the value. <a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExamplePlaceholder.vue">[Source]</a></p>
43+
<p>
44+
Vue Scroll Picker provides a placeholder option. When setting a
45+
placeholder, you can use null as the value.
46+
<a
47+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExamplePlaceholder.vue"
48+
>[Source]</a
49+
>
50+
</p>
2151
<ExamplePlaceholder :options="defaultOptions" />
2252

2353
<h2 id="slot_support"><a href="#slot_support">Slot Support</a></h2>
24-
<p><a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleSlot.vue">[Source]</a></p>
54+
<p>
55+
<a
56+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleSlot.vue"
57+
>[Source]</a
58+
>
59+
</p>
2560
<ExampleSlot />
2661

2762
<h2 id="event"><a href="#event">Event</a></h2>
28-
<p><a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleEvent.vue">[Source]</a></p>
63+
<p>
64+
<a
65+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleEvent.vue"
66+
>[Source]</a
67+
>
68+
</p>
2969
<ExampleEvent :options="defaultOptions" />
3070

3171
<h2 id="sensitivity"><a href="#sensitivity">Sensitivity</a></h2>
32-
<p><a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleSensitivity.vue">[Source]</a></p>
72+
<p>
73+
<a
74+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleSensitivity.vue"
75+
>[Source]</a
76+
>
77+
</p>
3378
<ExampleSensitivity :options="defaultOptions" />
3479

3580
<h2 id="transition"><a href="#transition">Transition</a></h2>
36-
<p><a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleTransition.vue">[Source]</a></p>
81+
<p>
82+
<a
83+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleTransition.vue"
84+
>[Source]</a
85+
>
86+
</p>
3787
<ExampleTransition :options="defaultOptions" />
3888

39-
<h2 id="dynamic_options"><a href="#dynamic_options">Dynamic Options</a></h2>
40-
<p><a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleDynamicOptions.vue">[Source]</a></p>
89+
<h2 id="dynamic_options">
90+
<a href="#dynamic_options">Dynamic Options</a>
91+
</h2>
92+
<p>
93+
<a
94+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleDynamicOptions.vue"
95+
>[Source]</a
96+
>
97+
</p>
4198
<ExampleDynamicOptions />
4299

43-
<h2 id="reactive_style"><a href="#reactive_style">Reactive Style</a></h2>
44-
<p><a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleReactiveStyle.vue">[Source]</a></p>
100+
<h2 id="reactive_style">
101+
<a href="#reactive_style">Reactive Style</a>
102+
</h2>
103+
<p>
104+
<a
105+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleReactiveStyle.vue"
106+
>[Source]</a
107+
>
108+
</p>
45109
<ExampleReactiveStyle :options="defaultOptions" />
46110

47111
<h2 id="dialog"><a href="#dialog">Dialog</a></h2>
48-
<p><a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleDialog.vue">[Source]</a></p>
112+
<p>
113+
<a
114+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleDialog.vue"
115+
>[Source]</a
116+
>
117+
</p>
49118
<ExampleDialog :options="defaultOptions" />
50119

51120
<h2 id="multiple"><a href="#multiple">Multiple</a></h2>
52-
<p><a href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleMultiple.vue">[Source]</a></p>
121+
<p>
122+
<a
123+
href="https://github.com/wan2land/vue-scroll-picker/blob/main/example/ExampleMultiple.vue"
124+
>[Source]</a
125+
>
126+
</p>
53127
<ExampleMultiple />
54128
</div>
55129
</div>
@@ -72,7 +146,6 @@ import ExampleSensitivity from './ExampleSensitivity.vue'
72146
import ExampleSlot from './ExampleSlot.vue'
73147
import ExampleTransition from './ExampleTransition.vue'
74148
75-
76149
export default defineComponent({
77150
components: {
78151
ExampleFullBinding,

example/ExampleDialog.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<template>
22
<div>
3-
<p>currentValue = <strong>{{ currentValue === null ? '(null)' : currentValue }}</strong></p>
4-
<button type="button" class="button" @click="handleClick">Open Dialog</button>
3+
<p>
4+
currentValue =
5+
<strong>{{ currentValue === null ? '(null)' : currentValue }}</strong>
6+
</p>
7+
<button type="button" class="button" @click="handleClick">
8+
Open Dialog
9+
</button>
510
<dialog>
611
<VueScrollPicker v-model="currentValue" :options="options" />
712
</dialog>
@@ -11,7 +16,6 @@
1116
import { defineComponent, PropType } from 'vue'
1217
import { VueScrollPickerOption } from 'vue-scroll-picker'
1318
14-
1519
export default defineComponent({
1620
props: {
1721
options: {
@@ -64,5 +68,4 @@ dialog:not([open]),
6468
dialog:not([open])::backdrop {
6569
opacity: 0;
6670
}
67-
6871
</style>

example/ExampleDisabledItems.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<template>
22
<div>
3-
<p>currentValue = <strong>{{ currentValue === null ? '(null)' : currentValue }}</strong></p>
3+
<p>
4+
currentValue =
5+
<strong>{{ currentValue === null ? '(null)' : currentValue }}</strong>
6+
</p>
47
<div class="button-group">
58
<a
69
class="button"
7-
:class="{active: currentValue === null}"
10+
:class="{ active: currentValue === null }"
811
@click="currentValue = null"
9-
>(null)</a>
12+
>(null)</a
13+
>
1014
<a
1115
class="button"
12-
:class="{active: currentValue === 'unknown'}"
16+
:class="{ active: currentValue === 'unknown' }"
1317
@click="currentValue = 'unknown'"
14-
>(Unknown)</a>
18+
>(Unknown)</a
19+
>
1520
<a
1621
v-for="(option, index) in options"
1722
:key="index"
@@ -21,7 +26,8 @@
2126
disabled: option.disabled,
2227
}"
2328
@click="currentValue = option.value"
24-
>{{ option.name }}</a>
29+
>{{ option.name }}</a
30+
>
2531
</div>
2632
<VueScrollPicker v-model="currentValue" :options="options" />
2733
</div>

example/ExampleDynamicOptions.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
<template>
22
<div>
3-
<p>currentValue = <strong>{{ currentValue === null ? '(null)' : currentValue }}</strong></p>
3+
<p>
4+
currentValue =
5+
<strong>{{ currentValue === null ? '(null)' : currentValue }}</strong>
6+
</p>
47
<div class="button-group">
58
<a class="button" @click="pushItem">Push Random Item</a>
69
<a class="button" @click="popItem">Pop Item</a>
710
<a class="button" @click="unshiftItem">Unshift Random Item</a>
811
<a class="button" @click="shiftItem">Shift Item</a>
912
<a class="button" @click="replaceItems">Replace 10 Items</a>
1013
</div>
11-
<VueScrollPicker :options="options" v-model="currentValue" />
14+
<VueScrollPicker v-model="currentValue" :options="options" />
1215
</div>
1316
</template>
1417
<script lang="ts">
1518
import { defineComponent } from 'vue'
1619
17-
1820
export default defineComponent({
1921
data() {
2022
return {

example/ExampleEvent.vue

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts" setup>
2-
import { PropType, ref } from 'vue';
3-
import { VueScrollPicker, VueScrollPickerOption } from 'vue-scroll-picker';
2+
import { PropType, ref } from 'vue'
3+
import { VueScrollPicker, VueScrollPickerOption } from 'vue-scroll-picker'
44
55
defineProps({
66
options: {
@@ -14,28 +14,34 @@ const currentValue = ref<unknown>(null)
1414
const logMessages = ref<string[]>([])
1515
1616
function log(event: string, ...args: unknown[]) {
17-
logMessages.value.unshift(`@${event}(${args.map(arg => JSON.stringify(arg)).join(', ')})`)
17+
logMessages.value.unshift(
18+
`@${event}(${args.map((arg) => JSON.stringify(arg)).join(', ')})`,
19+
)
1820
if (logMessages.value.length > 100) {
1921
logMessages.value.pop()
2022
}
2123
}
22-
2324
</script>
2425
<template>
2526
<div class="container">
2627
<div class="example">
27-
<p>currentValue = <strong>{{ currentValue === null ? '(null)' : currentValue }}</strong></p>
28+
<p>
29+
currentValue =
30+
<strong>{{ currentValue === null ? '(null)' : currentValue }}</strong>
31+
</p>
2832
<div class="button-group">
2933
<a
3034
class="button"
31-
:class="{active: currentValue === null}"
35+
:class="{ active: currentValue === null }"
3236
@click="currentValue = null"
33-
>(null)</a>
37+
>(null)</a
38+
>
3439
<a
3540
class="button"
36-
:class="{active: currentValue === 'unknown'}"
41+
:class="{ active: currentValue === 'unknown' }"
3742
@click="currentValue = 'unknown'"
38-
>(Unknown)</a>
43+
>(Unknown)</a
44+
>
3945
<a
4046
v-for="(option, index) in options"
4147
:key="index"
@@ -45,7 +51,8 @@ function log(event: string, ...args: unknown[]) {
4551
disabled: option.disabled,
4652
}"
4753
@click="currentValue = option.value"
48-
>{{ option.name }}</a>
54+
>{{ option.name }}</a
55+
>
4956
</div>
5057
<VueScrollPicker
5158
v-model="currentValue"
@@ -61,7 +68,9 @@ function log(event: string, ...args: unknown[]) {
6168
</div>
6269
<div class="log-container">
6370
<div class="log">
64-
<div v-for="(logMessage, index) in logMessages" :key="index">{{ logMessage }}</div>
71+
<div v-for="(logMessage, index) in logMessages" :key="index">
72+
{{ logMessage }}
73+
</div>
6574
</div>
6675
</div>
6776
</div>
@@ -95,9 +104,8 @@ function log(event: string, ...args: unknown[]) {
95104
.container {
96105
flex-direction: row;
97106
}
98-
.log-container{
107+
.log-container {
99108
height: auto;
100109
}
101110
}
102-
103111
</style>

0 commit comments

Comments
 (0)