Skip to content

Commit 88cf033

Browse files
committed
docs: add lint:fix requirement to coding guidelines
- Add rule to always run pnpm run lint:fix after code changes - Format components/object/list.vue to comply with Prettier
1 parent 74cfe21 commit 88cf033

2 files changed

Lines changed: 48 additions & 24 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
## Coding Style & Naming Conventions
2020

2121
- Use Prettier defaults (see `.prettierrc.ts`); run `pnpm lint` or `pnpm lint:fix`.
22+
- **Always run `pnpm run lint:fix` after making code changes to ensure formatting compliance before committing.**
2223
- Vue files use `<script setup>` with TypeScript; prefer composables for shared logic.
2324
- Component files use **kebab-case** (e.g. `bucket-selector.vue`), but reference them using **StudlyCase** in templates (e.g. `<BucketSelector />`).
2425
- Override shadcn primitives **outside** `components/ui/`; never edit files in that directory directly.

‎components/object/list.vue‎

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
<Icon name="ri:file-add-line" class="size-4" />
2020
<span>{{ t('Upload File') }}/{{ t('Folder') }}</span>
2121
</Button>
22-
<Button variant="outline" class="text-destructive border-destructive" :disabled="!checkedKeys.length" v-show="checkedKeys.length" @click="handleBatchDelete">
22+
<Button
23+
variant="outline"
24+
class="text-destructive border-destructive"
25+
:disabled="!checkedKeys.length"
26+
v-show="checkedKeys.length"
27+
@click="handleBatchDelete"
28+
>
2329
<Icon name="ri:delete-bin-5-line" class="size-4" />
2430
<span>{{ t('Delete Selected') }}</span>
2531
</Button>
@@ -34,7 +40,12 @@
3440
</template>
3541
</page-header>
3642

37-
<DataTable :table="table" :is-loading="loading" :empty-title="t('No Objects')" :empty-description="t('Upload files or create folders to populate this bucket.')" />
43+
<DataTable
44+
:table="table"
45+
:is-loading="loading"
46+
:empty-title="t('No Objects')"
47+
:empty-description="t('Upload files or create folders to populate this bucket.')"
48+
/>
3849

3950
<div class="flex justify-end gap-2">
4051
<Button variant="outline" :disabled="!continuationToken" @click="goToPreviousPage">
@@ -48,18 +59,29 @@
4859
</div>
4960
</div>
5061

51-
<object-upload-picker :show="uploadPickerVisible" :bucketName="bucketName" :prefix="prefix" @update:show="
52-
val => {
53-
uploadPickerVisible = val
54-
refresh()
55-
}
56-
" />
57-
<object-new-form :show="newObjectFormVisible" :bucketName="bucketName" :prefix="prefix" :asPrefix="newObjectAsPrefix" @update:show="
58-
val => {
59-
newObjectFormVisible = val
60-
refresh()
61-
}
62-
" />
62+
<object-upload-picker
63+
:show="uploadPickerVisible"
64+
:bucketName="bucketName"
65+
:prefix="prefix"
66+
@update:show="
67+
val => {
68+
uploadPickerVisible = val
69+
refresh()
70+
}
71+
"
72+
/>
73+
<object-new-form
74+
:show="newObjectFormVisible"
75+
:bucketName="bucketName"
76+
:prefix="prefix"
77+
:asPrefix="newObjectAsPrefix"
78+
@update:show="
79+
val => {
80+
newObjectFormVisible = val
81+
refresh()
82+
}
83+
"
84+
/>
6385
<object-info ref="infoRef" :bucket-name="bucketName" @refresh-parent="handleObjectDeleted" />
6486
</template>
6587

@@ -208,8 +230,9 @@ const fetchObjects = async (): Promise<ObjectRow[]> => {
208230
}
209231
210232
const asyncDataCacheKey = computed(() => {
211-
return `objects-${bucketName.value}-${prefix.value}-${continuationToken.value || 'start'}-${searchTerm.value || 'all'}-${showDeleted.value ? 'withDeleted' : 'withoutDeleted'
212-
}`
233+
return `objects-${bucketName.value}-${prefix.value}-${continuationToken.value || 'start'}-${searchTerm.value || 'all'}-${
234+
showDeleted.value ? 'withDeleted' : 'withoutDeleted'
235+
}`
213236
})
214237
215238
const displayKey = (key: string) => {
@@ -295,14 +318,14 @@ const columns = computed<ColumnDef<ObjectRow, any>[]>(() => {
295318
h('div', { class: 'flex items-center gap-2' }, [
296319
row.original.type === 'object'
297320
? h(
298-
Button,
299-
{
300-
variant: 'outline',
301-
size: 'sm',
302-
onClick: () => downloadFile(row.original.Key),
303-
},
304-
() => [h(Icon, { name: 'ri:download-cloud-2-line', class: 'size-4' }), h('span', t('Download'))]
305-
)
321+
Button,
322+
{
323+
variant: 'outline',
324+
size: 'sm',
325+
onClick: () => downloadFile(row.original.Key),
326+
},
327+
() => [h(Icon, { name: 'ri:download-cloud-2-line', class: 'size-4' }), h('span', t('Download'))]
328+
)
306329
: null,
307330
h(
308331
Button,

0 commit comments

Comments
 (0)