Skip to content

Commit 3976e26

Browse files
committed
chore: update eslint config to Vue 3
Signed-off-by: Maksim Sukharev <[email protected]>
1 parent 0bf831d commit 3976e26

File tree

7 files changed

+51
-42
lines changed

7 files changed

+51
-42
lines changed

eslint.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import { recommendedVue2 } from '@nextcloud/eslint-config'
6+
import { recommended } from '@nextcloud/eslint-config'
77

88
export default [
9-
...recommendedVue2,
9+
...recommended,
1010
{
1111
name: 'logreader/disabled-during-migration',
1212
rules: {

package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,20 @@
11
{
22
"name": "logreader",
3+
"version": "6.0.0-dev.0",
34
"type": "module",
45
"scripts": {
56
"build": "vite --mode production build",
67
"dev": "vite --mode development build",
78
"dev:watch": "vite --mode development build --watch",
8-
"lint": "eslint src *.ts",
9-
"lint:fix": "eslint --fix src *.ts",
9+
"lint": "eslint",
10+
"lint:fix": "eslint --fix",
1011
"test": "TZ='Etc/GMT+1' vitest run",
11-
"test:watch": "TZ='Etc/GMT+1' vitest watch",
12-
"test:coverage": "TZ='Etc/GMT+1' vitest run --coverage"
13-
},
14-
"devDependencies": {
15-
"@nextcloud/browserslist-config": "^3.1.2",
16-
"@nextcloud/eslint-config": "^9.0.0-rc.5",
17-
"@nextcloud/vite-config": "^2.5.2",
18-
"@pinia/testing": "^1.0.3",
19-
"@vitest/coverage-istanbul": "^4.0.13",
20-
"@vue/test-utils": "^2.4.6",
21-
"@vue/tsconfig": "^0.8.1",
22-
"browserslist": "^4.28.0",
23-
"happy-dom": "^20.0.10",
24-
"typescript": "^5.9.3",
25-
"vite": "^7.2.4",
26-
"vitest": "^4.0.13"
27-
},
28-
"engines": {
29-
"node": "^24.0.0",
30-
"npm": "^11.3.0"
12+
"test:coverage": "TZ='Etc/GMT+1' vitest run --coverage",
13+
"test:watch": "TZ='Etc/GMT+1' vitest watch"
3114
},
15+
"browserslist": [
16+
"extends @nextcloud/browserslist-config"
17+
],
3218
"dependencies": {
3319
"@highlightjs/vue-plugin": "^2.1.0",
3420
"@mdi/svg": "^7.4.47",
@@ -46,8 +32,22 @@
4632
"vue": "^3.5.24",
4733
"vue-material-design-icons": "^5.3.1"
4834
},
49-
"browserslist": [
50-
"extends @nextcloud/browserslist-config"
51-
],
52-
"version": "6.0.0-dev.0"
35+
"devDependencies": {
36+
"@nextcloud/browserslist-config": "^3.1.2",
37+
"@nextcloud/eslint-config": "^9.0.0-rc.5",
38+
"@nextcloud/vite-config": "^2.5.2",
39+
"@pinia/testing": "^1.0.3",
40+
"@vitest/coverage-istanbul": "^4.0.13",
41+
"@vue/test-utils": "^2.4.6",
42+
"@vue/tsconfig": "^0.8.1",
43+
"browserslist": "^4.28.0",
44+
"happy-dom": "^20.0.10",
45+
"typescript": "^5.9.3",
46+
"vite": "^7.2.4",
47+
"vitest": "^4.0.13"
48+
},
49+
"engines": {
50+
"node": "^24.0.0",
51+
"npm": "^11.3.0"
52+
}
5353
}

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</template>
4646
</NcEmptyContent>
4747
<!-- App settings dialog will be mounted on page body -->
48-
<AppSettingsDialog :open.sync="areSettingsShown" />
48+
<AppSettingsDialog v-model:open="areSettingsShown" />
4949
</div>
5050
</template>
5151

src/components/LogDetailsModal.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
size="large"
1010
:has-previous="index > 0"
1111
:has-next="index < logEntries.length - 1"
12-
@next="$emit('update:currentEntry', logEntries[index + 1])"
13-
@previous="$emit('update:currentEntry', logEntries[index - 1])"
14-
@update:show="$emit('update:open', false)">
12+
@next="emit('update:currentEntry', logEntries[index + 1])"
13+
@previous="emit('update:currentEntry', logEntries[index - 1])"
14+
@update:show="emit('update:open', false)">
1515
<template #default>
1616
<div class="log-details">
1717
<dl :class="cssLevelClass">
@@ -82,6 +82,11 @@ const props = defineProps<{
8282
logEntries: readonly ILogEntry[]
8383
}>()
8484
85+
const emit = defineEmits<{
86+
(event: 'update:currentEntry', value: ILogEntry): void
87+
(event: 'update:open', value: false): void
88+
}>()
89+
8590
hljs.registerLanguage('json', json)
8691
8792
const { formatTime, formatLogEntry } = useLogFormatting()

src/components/LogSearch.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
<template>
77
<NcActions
8+
v-model:open="isOpen"
89
:force-menu="true"
9-
:open.sync="isOpen"
1010
:aria-label="t('logreader', 'Search log entries')"
1111
:type="buttonType">
1212
<template #icon>

src/components/table/LogTable.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
<div class="log-table">
88
<LogDetailsModal
99
v-if="currentRow"
10-
:open.sync="isModalOpen"
11-
:current-entry.sync="currentRow"
10+
v-model:open="isModalOpen"
11+
v-model:current-entry="currentRow"
1212
:log-entries="sortedRows" />
1313
<table ref="tableRoot" class="log-table__table">
1414
<thead role="rowgroup" class="log-table__header">
1515
<tr>
1616
<LogTableHeader
17-
:name="t('logreader', 'Level')"
18-
:sorted.sync="sortedByLevel" />
17+
v-model:sorted="sortedByLevel"
18+
:name="t('logreader', 'Level')" />
1919
<LogTableHeader
20-
:name="t('logreader', 'Application')"
21-
:sorted.sync="sortedByApp" />
20+
v-model:sorted="sortedByApp"
21+
:name="t('logreader', 'Application')" />
2222
<LogTableHeader :name="t('logreader', 'Message')" :sortable="false">
2323
<LogSearch />
2424
</LogTableHeader>
2525
<LogTableHeader
26-
:name="t('logreader', 'Time')"
27-
:sorted.sync="sortedByTime" />
26+
v-model:sorted="sortedByTime"
27+
:name="t('logreader', 'Time')" />
2828
<th><span class="hidden-visually">{{ t('logreader', 'Log entry actions') }}</span></th>
2929
</tr>
3030
</thead>

src/components/table/LogTableRow.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</td>
4848
<td>
4949
<NcActions placement="left-start">
50-
<NcActionButton close-after-click @click="$emit('show-details', row)">
50+
<NcActionButton close-after-click @click="emit('showDetails', row)">
5151
<template #icon>
5252
<IconViewList />
5353
</template>
@@ -100,6 +100,10 @@ const props = withDefaults(
100100
},
101101
)
102102
103+
const emit = defineEmits<{
104+
(event: 'showDetails', value: ILogEntry): void
105+
}>()
106+
103107
const settingsStore = useSettingsStore()
104108
const isRawDate = computed(() => settingsStore.dateTimeFormat === 'raw')
105109
const isRelativeDate = computed(() => settingsStore.dateTimeFormat === 'relative')

0 commit comments

Comments
 (0)