Skip to content

Commit 37c7202

Browse files
committed
eslint-plugin-vue
1 parent 791140e commit 37c7202

File tree

8 files changed

+379
-58
lines changed

8 files changed

+379
-58
lines changed

.eslintrc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"plugins": ["@typescript-eslint"],
5-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"]
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:vue/vue3-essential",
7+
"plugin:vue/vue3-recommended",
8+
"@vue/prettier",
9+
"@vue/typescript"
10+
]
611
}

app/components/ltFilesSelector.vue

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<h2 class="mt-4" v-hide="userInfo" translate="translate">Sign in</h2>
2+
<h2 v-hide="userInfo" class="mt-4" translate="translate">Sign in</h2>
33
<p v-hide="userInfo">
44
<span translate="translate">
55
In order to allow locator-tool to modify file description pages, sign in first:
@@ -18,8 +18,8 @@
1818
<button
1919
class="nav-link"
2020
translate="translate"
21-
@click="$tab = Tab.CATEGORY"
2221
:class="{active: $tab === Tab.CATEGORY}"
22+
@click="$tab = Tab.CATEGORY"
2323
>
2424
Category
2525
</button>
@@ -28,8 +28,8 @@
2828
<button
2929
class="nav-link"
3030
translate="translate"
31-
@click="$tab = Tab.USER"
3231
:class="{active: $tab === Tab.USER}"
32+
@click="$tab = Tab.USER"
3333
>
3434
User files
3535
</button>
@@ -38,17 +38,17 @@
3838
<button
3939
class="nav-link"
4040
translate="translate"
41-
@click="$tab = Tab.FILES"
4241
:class="{active: $tab === Tab.FILES}"
42+
@click="$tab = Tab.FILES"
4343
>
4444
File list
4545
</button>
4646
</li>
4747
</ul>
48-
<form name="formUser" @submit="nextForUser()" v-show="$tab === Tab.USER">
48+
<form v-show="$tab === Tab.USER" name="formUser" @submit="nextForUser()">
4949
<div class="mb-4">
5050
<label for="inputUser" translate="translate">User</label>
51-
<input class="form-control" id="inputUser" v-model="user" placeholder="User:…" />
51+
<input id="inputUser" v-model="user" class="form-control" placeholder="User:…" />
5252
</div>
5353
<div class="row">
5454
<div class="mb-4 col-sm-4">
@@ -59,31 +59,31 @@
5959
>
6060
Limit
6161
</label>
62-
<input class="form-control" id="inputUserLimit" v-model="userLimit" type="number" />
62+
<input id="inputUserLimit" v-model="userLimit" class="form-control" type="number" />
6363
</div>
6464
<div class="mb-4 col-sm-4">
6565
<label for="inputUserStart" translate="translate">Start timestamp</label>
66-
<input class="form-control" id="inputUserStart" v-model="userStart" type="date" />
66+
<input id="inputUserStart" v-model="userStart" class="form-control" type="date" />
6767
</div>
6868
<div class="mb-4 col-sm-4">
6969
<label for="inputUserEnd" translate="translate">End timestamp</label>
70-
<input class="form-control" id="inputUserEnd" v-model="userEnd" type="date" />
70+
<input id="inputUserEnd" v-model="userEnd" class="form-control" type="date" />
7171
</div>
7272
</div>
7373
<div class="mb-4">
74-
<button class="btn btn-success" @click="nextForUser()" :disabled="!user">
74+
<button class="btn btn-success" :disabled="!user" @click="nextForUser()">
7575
<svg class="octicon">
7676
<use xlink:href="#location"></use>
7777
</svg>
7878
<span translate="translate">Load User files to geolocate</span>
7979
</button>
80-
<button class="btn btn-secondary" @click="nextForUser('map')" :disabled="!user">
80+
<button class="btn btn-secondary" :disabled="!user" @click="nextForUser('map')">
8181
<svg class="octicon">
8282
<use xlink:href="#globe"></use>
8383
</svg>
8484
<span translate="translate">Show User files on map</span>
8585
</button>
86-
<button class="btn btn-secondary" @click="nextForUser('gallery')" :disabled="!user">
86+
<button class="btn btn-secondary" :disabled="!user" @click="nextForUser('gallery')">
8787
<svg class="octicon">
8888
<use xlink:href="#file-media"></use>
8989
</svg>
@@ -93,18 +93,18 @@
9393
</div>
9494
<lt-spinner v-if="getFilesForUser$q && !getFilesForUser$q.$$state.status"></lt-spinner>
9595
</form>
96-
<form name="formCategory" @submit="nextForCategory()" v-show="$tab === Tab.CATEGORY">
96+
<form v-show="$tab === Tab.CATEGORY" name="formCategory" @submit="nextForCategory()">
9797
<div class="row">
9898
<div class="mb-4 col-lg-10">
9999
<label for="inputCategory" translate="translate">Category</label>
100100
<input
101-
class="form-control"
102101
id="inputCategory"
103-
list="datalistCategory"
104102
v-model="category"
105103
v-model-options="{updateOn: 'default blur', debounce: {default: 500, change: 0, blur: 0}}"
106-
@change="getCategoriesForPrefix()"
104+
class="form-control"
105+
list="datalistCategory"
107106
placeholder="Category:…"
107+
@change="getCategoriesForPrefix()"
108108
/>
109109
</div>
110110
<div class="mb-4 col-lg-2">
@@ -116,23 +116,23 @@
116116
>
117117
Depth
118118
</label>
119-
<input class="form-control" id="inputCategoryDepth" type="number" v-model="categoryDepth" />
119+
<input id="inputCategoryDepth" v-model="categoryDepth" class="form-control" type="number" />
120120
</div>
121121
</div>
122122
<div class="mb-4">
123-
<button class="btn btn-success" @click="nextForCategory()" :disabled="!category">
123+
<button class="btn btn-success" :disabled="!category" @click="nextForCategory()">
124124
<svg class="octicon">
125125
<use xlink:href="#location"></use>
126126
</svg>
127127
<span translate="translate">Load Category to geolocate</span>
128128
</button>
129-
<button class="btn btn-secondary" @click="nextForCategory('map')" :disabled="!category">
129+
<button class="btn btn-secondary" :disabled="!category" @click="nextForCategory('map')">
130130
<svg class="octicon">
131131
<use xlink:href="#globe"></use>
132132
</svg>
133133
<span translate="translate">Show Category on map</span>
134134
</button>
135-
<button class="btn btn-secondary" @click="nextForCategory('gallery')" :disabled="!category">
135+
<button class="btn btn-secondary" :disabled="!category" @click="nextForCategory('gallery')">
136136
<svg class="octicon">
137137
<use xlink:href="#file-media"></use>
138138
</svg>
@@ -142,17 +142,17 @@
142142
</div>
143143
<lt-spinner v-if="getFilesForCategory$q && !getFilesForCategory$q.$$state.status"></lt-spinner>
144144
<datalist id="datalistCategory">
145-
<option v-for="i in categorySuggestions" :value="i"></option>
145+
<option v-for="i in categorySuggestions" :key="i" :value="i"></option>
146146
</datalist>
147147
</form>
148-
<form name="formTitles" v-show="$tab === Tab.FILES">
148+
<form v-show="$tab === Tab.FILES" name="formTitles">
149149
<div class="mb-4">
150150
<label for="inputTitles" translate="translate">File list</label>
151151
<textarea
152-
class="form-control"
153152
id="inputTitles"
154-
rows="10"
155153
v-model="titles"
154+
class="form-control"
155+
rows="10"
156156
placeholder="File:…"
157157
@paste="onFilesPaste($event)"
158158
></textarea>

app/components/ltLanguageSelector.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<select class="form-select" v-model="language">
3-
<option v-for="(label, key) in languages" :value="key">{{ label }}</option>
2+
<select v-model="language" class="form-select">
3+
<option v-for="(label, key) in languages" :key="key" :value="key">{{ label }}</option>
44
</select>
55
<span
66
hidden="hidden"

app/components/ltNavbar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
</li>
2626
<li class="nav-item">
2727
<router-link
28-
class="nav-link"
2928
v-show="activateLinks"
29+
class="nav-link"
3030
:to="{name: 'geolocate', params: $route.query}"
3131
>
3232
<svg class="octicon">
@@ -37,8 +37,8 @@
3737
</li>
3838
<li class="nav-item">
3939
<router-link
40-
class="nav-link"
4140
v-show="activateLinks"
41+
class="nav-link"
4242
:to="{name: 'map', params: $route.query}"
4343
>
4444
<svg class="octicon">
@@ -49,8 +49,8 @@
4949
</li>
5050
<li class="nav-item">
5151
<router-link
52-
class="nav-link"
5352
v-show="activateLinks"
53+
class="nav-link"
5454
:to="{name: 'gallery', params: $route.query}"
5555
>
5656
<svg class="octicon">

app/components/ltUserInfo.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<template>
2-
<a class="btn btn-success ms-2" :href="loginURL()" v-hide="userInfo?.user">
2+
<a v-hide="userInfo?.user" class="btn btn-success ms-2" :href="loginURL()">
33
<svg class="octicon">
44
<use xlink:href="#sign-in"></use>
55
</svg>
66
<span translate="translate">Log in</span>
77
</a>
8-
<span class="navbar-text ms-2" v-show="userInfo?.user" translate="translate">
8+
<span v-show="userInfo?.user" class="navbar-text ms-2" translate="translate">
99
Logged in as {{ userInfo?.user }}
1010
</span>
11-
<a class="btn btn-secondary ms-2" :href="logoutURL()" v-show="userInfo?.user">
11+
<a v-show="userInfo?.user" class="btn btn-secondary ms-2" :href="logoutURL()">
1212
<svg class="octicon">
1313
<use xlink:href="#sign-out"></use>
1414
</svg>

app/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import './vendor';
88
import './vendor-leaflet';
99
import './style.css';
1010

11-
const params = [
12-
'files',
13-
'user',
14-
'userLimit',
15-
'userStart',
16-
'userEnd',
17-
'category',
18-
'categoryDepth'
19-
].join('&');
11+
// const params = [
12+
// 'files',
13+
// 'user',
14+
// 'userLimit',
15+
// 'userStart',
16+
// 'userEnd',
17+
// 'category',
18+
// 'categoryDepth'
19+
// ].join('&');
2020

2121
const router = createRouter({
2222
history: createWebHashHistory(),

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@
5555
"@typescript-eslint/eslint-plugin": "^6.5.0",
5656
"@typescript-eslint/parser": "^6.5.0",
5757
"@vitejs/plugin-vue": "^5.0.3",
58+
"@vue/eslint-config-prettier": "^9.0.0",
59+
"@vue/eslint-config-typescript": "^12.0.0",
5860
"angular-gettext-cli": "^1.2.0",
5961
"angular-gettext-tools": "^2.3.5",
6062
"eslint": "^8.48.0",
63+
"eslint-plugin-prettier": "^5.1.3",
64+
"eslint-plugin-vue": "^9.20.1",
6165
"husky": "^7.0.4",
6266
"lint-staged": "^12.4.0",
6367
"prettier": "^3.0.3",

0 commit comments

Comments
 (0)