Skip to content

Commit 82ffd75

Browse files
authored
Merge pull request #286 from DigitalSlideArchive/lint-pkg-upgrades
Lint pkg upgrades
2 parents c316c10 + 919ec3d commit 82ffd75

13 files changed

Lines changed: 510 additions & 450 deletions

client/.eslintrc.cjs

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

client/eslint.config.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import eslint from '@eslint/js';
2+
import eslintConfigPrettier from 'eslint-config-prettier';
3+
import eslintPluginVue from 'eslint-plugin-vue';
4+
import globals from 'globals';
5+
import typescriptEslint from 'typescript-eslint';
6+
7+
export default typescriptEslint.config(
8+
{ ignores: ['*.d.ts', '.yarn/**', '.gitignore', '.pnp.*'] },
9+
{
10+
extends: [
11+
eslint.configs.recommended,
12+
...typescriptEslint.configs.recommended,
13+
...eslintPluginVue.configs['flat/recommended'],
14+
],
15+
files: ['**/*.{ts,tsx,vue,js,jsx,cjs,mjs,cts,mts}'],
16+
17+
languageOptions: {
18+
globals: globals.browser,
19+
ecmaVersion: 'latest',
20+
sourceType: "module",
21+
22+
parserOptions: {
23+
parser: "@typescript-eslint/parser",
24+
},
25+
},
26+
},
27+
eslintConfigPrettier
28+
);

client/package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"lint:tsc": "vue-tsc --noEmit",
9-
"lint:check": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore --fix ",
9+
"lint:check": "eslint . --fix ",
1010
"lint:format": "prettier src --write",
1111
"lint": "npm-run-all lint:tsc lint:check lint:format",
1212
"dev": "NODE_ENV=development vite --port 8080",
@@ -15,27 +15,31 @@
1515
"build": "npm-run-all build:clean build:compile"
1616
},
1717
"dependencies": {
18-
"eslint-config-prettier": "^9.1.0",
1918
"remixicon": "^3.6.0",
2019
"vue": "^3.3.4"
2120
},
2221
"devDependencies": {
23-
"@typescript-eslint/eslint-plugin": "^7.4.0",
24-
"@typescript-eslint/parser": "^7.4.0",
22+
"@eslint/eslintrc": "^3.2.0",
23+
"@eslint/js": "^9.17.0",
24+
"@typescript-eslint/eslint-plugin": "^8.19.1",
25+
"@typescript-eslint/parser": "^8.19.1",
2526
"@vitejs/plugin-vue": "^4.2.3",
2627
"autoprefixer": "^10.4.16",
2728
"daisyui": "^4.0.7",
28-
"eslint": "^8.56.0",
29-
"eslint-plugin-vue": "^9.19.2",
29+
"eslint": "^9.17.0",
30+
"eslint-config-prettier": "^9.1.0",
31+
"eslint-plugin-vue": "^9.32.0",
32+
"globals": "^15.14.0",
3033
"npm-run-all": "^4.1.5",
3134
"postcss": "^8.4.31",
3235
"prettier": "^3.1.1",
3336
"rimraf": "^5.0.5",
3437
"tailwindcss": "^3.3.5",
3538
"typescript": "^5.3.3",
39+
"typescript-eslint": "^8.19.1",
3640
"vite": "^4.5.5",
37-
"vue-eslint-parser": "^9.4.2",
38-
"vue-tsc": "^1.8.5"
41+
"vue-eslint-parser": "^9.4.3",
42+
"vue-tsc": "^2.2.0"
3943
},
4044
"packageManager": "yarn@4.5.1+sha256.dc2e45a77f87a9c2a76708d098ab54ca0cfdd5ec2cf7d9e3c1f24bf786a2383c",
4145
"dependenciesMeta": {

client/src/HomePage.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ onMounted(() => {
125125
</div>
126126
<div class="flex items-center space-y-0.5">
127127
<a class="btn btn-ghost btn-square btn-sm">
128-
<i class="ri-side-bar-line text-lg text-neutral"></i>
128+
<i class="ri-side-bar-line text-lg text-neutral" />
129129
</a>
130130
</div>
131131
</div>
@@ -152,8 +152,8 @@ onMounted(() => {
152152
:modal-id="'inputDirectory'"
153153
:title="'Input Directory'"
154154
@update-image-list="
155-
((redactionStateFlags.showImageTable = true),
156-
(redactionStateFlags.redactionComplete = false))
155+
(redactionStateFlags.showImageTable = true),
156+
(redactionStateFlags.redactionComplete = false)
157157
"
158158
/>
159159
<FileBrowser
@@ -186,7 +186,7 @@ onMounted(() => {
186186
<h2 class="font-bold text-xl text-center">
187187
Missing Redaction Rules
188188
</h2>
189-
<div class="divider my-1"></div>
189+
<div class="divider my-1" />
190190
<p class="indent-8 font-medium">
191191
One or more images are missing redaction rules. If you continue
192192
these images will not be redacted.
@@ -230,7 +230,7 @@ onMounted(() => {
230230
class="progress progress-primary"
231231
:value="progress.count"
232232
:max="progress.max"
233-
></progress>
233+
/>
234234
</div>
235235
</div>
236236
</div>
@@ -253,7 +253,7 @@ onMounted(() => {
253253
class="btn btn-xs btn-ghost"
254254
@click="redactionStateFlags.redactionSnackbar = false"
255255
>
256-
<i class="ri-close-line"></i>
256+
<i class="ri-close-line" />
257257
</button>
258258
</div>
259259
</div>

client/src/components/FileBrowser.vue

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<script setup lang="ts">
22
import { ref, onMounted, onBeforeUnmount } from "vue";
3-
import { selectedDirectories, updateDirectories, directoryData, loadingData, calculateVisibleItems, visibleImages, remainingImages } from "../store/directoryStore";
3+
import {
4+
selectedDirectories,
5+
updateDirectories,
6+
directoryData,
7+
loadingData,
8+
calculateVisibleItems,
9+
visibleImages,
10+
remainingImages,
11+
} from "../store/directoryStore";
412
import { updateTableData } from "../store/imageStore";
513
614
const props = defineProps({
@@ -24,9 +32,18 @@ const closeModal = () => {
2432
2533
const updateSelectedDirectories = (path: string) => {
2634
selectedDirectories.value[props.modalId] = path;
27-
localStorage.setItem('inputDirectory', selectedDirectories.value.inputDirectory);
28-
localStorage.setItem('outputDirectory', selectedDirectories.value.outputDirectory);
29-
localStorage.setItem('rulesetDirectory', selectedDirectories.value.rulesetDirectory);
35+
localStorage.setItem(
36+
"inputDirectory",
37+
selectedDirectories.value.inputDirectory,
38+
);
39+
localStorage.setItem(
40+
"outputDirectory",
41+
selectedDirectories.value.outputDirectory,
42+
);
43+
localStorage.setItem(
44+
"rulesetDirectory",
45+
selectedDirectories.value.rulesetDirectory,
46+
);
3047
};
3148
3249
onMounted(() => {
@@ -52,17 +69,17 @@ onBeforeUnmount(() => {
5269
class="btn btn-primary float-right text-white uppercase"
5370
type="button"
5471
@click="
55-
($emit('update-image-list'),
56-
closeModal(),
57-
title !== 'Output Directory'
58-
? updateTableData({
59-
directory: selectedDirectories.inputDirectory,
60-
rules: selectedDirectories.rulesetDirectory,
61-
limit: 50,
62-
offset: 0,
63-
update: false,
64-
})
65-
: '')
72+
$emit('update-image-list'),
73+
closeModal(),
74+
title !== 'Output Directory'
75+
? updateTableData({
76+
directory: selectedDirectories.inputDirectory,
77+
rules: selectedDirectories.rulesetDirectory,
78+
limit: 50,
79+
offset: 0,
80+
update: false,
81+
})
82+
: ''
6683
"
6784
>
6885
Select
@@ -84,8 +101,8 @@ onBeforeUnmount(() => {
84101
v-else
85102
class="text-blue-700"
86103
@click="
87-
(updateDirectories(ancestor.path),
88-
updateSelectedDirectories(ancestor.path))
104+
updateDirectories(ancestor.path),
105+
updateSelectedDirectories(ancestor.path)
89106
"
90107
>
91108
{{ ancestor.name ? ancestor.name : "/" }}
@@ -94,10 +111,7 @@ onBeforeUnmount(() => {
94111
</ul>
95112
</div>
96113
</div>
97-
<div
98-
v-if="loadingData"
99-
class="text-center"
100-
>
114+
<div v-if="loadingData" class="text-center">
101115
<span class="loading loading-spinner text-primary"></span>
102116
<span class="ml-2 italic font-light align-top"
103117
>Collecting Directory Data</span
@@ -165,17 +179,17 @@ onBeforeUnmount(() => {
165179
<form method="dialog" class="modal-backdrop w-screen h-screen absolute">
166180
<button
167181
@click="
168-
($emit('update-image-list'),
169-
closeModal(),
170-
title !== 'Output Directory'
171-
? updateTableData({
172-
directory: selectedDirectories.inputDirectory,
173-
rules: selectedDirectories.rulesetDirectory,
174-
limit: 50,
175-
offset: 0,
176-
update: false,
177-
})
178-
: '')
182+
$emit('update-image-list'),
183+
closeModal(),
184+
title !== 'Output Directory'
185+
? updateTableData({
186+
directory: selectedDirectories.inputDirectory,
187+
rules: selectedDirectories.rulesetDirectory,
188+
limit: 50,
189+
offset: 0,
190+
update: false,
191+
})
192+
: ''
179193
"
180194
>
181195
close

client/src/components/ImageDataTable.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defineProps({
1212
</script>
1313
<template>
1414
<div v-if="!usedColumns" class="m-auto flex justify-center">
15-
Loading.. <span class="loading loading-bars loading-md"></span>
15+
Loading.. <span class="loading loading-bars loading-md" />
1616
</div>
1717
<table
1818
v-if="usedColumns"
@@ -50,7 +50,7 @@ defineProps({
5050
class="tooltip tooltip-right"
5151
:data-tip="`${image.missing_tags.length} tag(s) missing redaction rules.`"
5252
>
53-
<i class="ri-error-warning-fill text-red-600 text-xl"></i>
53+
<i class="ri-error-warning-fill text-red-600 text-xl" />
5454
<div v-for="(obj, pos) in image.missing_tags" :key="pos">
5555
<span v-for="(value, key) in obj" :key="key">
5656
{{ key }}: {{ value }}
@@ -63,7 +63,7 @@ defineProps({
6363
class="tooltip tooltip-right"
6464
:data-tip="`No missing redaction rules.`"
6565
>
66-
<i class="ri-checkbox-circle-fill text-green-600 text-xl"></i>
66+
<i class="ri-checkbox-circle-fill text-green-600 text-xl" />
6767
</div>
6868
</td>
6969
<template v-for="tag in usedColumns" :key="tag">

client/src/components/InfiniteScroller.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ onMounted(() => {
2626
ref="infiniteScroller"
2727
class="card rounded max-h-[calc(100vh-50px)] max-w-[calc(100vw-425px)] overflow-auto customScroll"
2828
>
29-
<slot></slot>
30-
<div ref="endOfTable"></div>
29+
<slot />
30+
<div ref="endOfTable" />
3131
</div>
3232
</template>
3333
<style scoped>

client/src/components/MenuSteps.vue

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@ const props = defineProps({
3333
});
3434
3535
const openModal = () => {
36-
props.stepTitle.includes("Input")
37-
? (props.inputModal.modal.showModal(),
38-
updateDirectories(selectedDirectories.value.inputDirectory))
39-
: props.stepTitle.includes("Output")
40-
? (props.outputModal.modal.showModal(),
41-
updateDirectories(selectedDirectories.value.outputDirectory))
42-
: (props.rulesetModal.modal.showModal(),
43-
updateDirectories(selectedDirectories.value.rulesetDirectory));
36+
if (props.stepTitle.includes("Input")) {
37+
props.inputModal.modal.showModal();
38+
updateDirectories(selectedDirectories.value.inputDirectory);
39+
} else if (props.stepTitle.includes("Output")) {
40+
props.outputModal.modal.showModal();
41+
updateDirectories(selectedDirectories.value.outputDirectory);
42+
} else {
43+
props.rulesetModal.modal.showModal();
44+
updateDirectories(selectedDirectories.value.rulesetDirectory);
45+
}
4446
};
4547
4648
const clearRuleset = () => {
@@ -84,7 +86,7 @@ const clearRuleset = () => {
8486
</div>
8587
</div>
8688
<button class="btn btn-ghost btn-square btn-sm" @click="openModal">
87-
<i class="ri-folder-open-fill text-secondary text-lg"></i>
89+
<i class="ri-folder-open-fill text-secondary text-lg" />
8890
</button>
8991
</div>
9092
<div
@@ -118,7 +120,7 @@ const clearRuleset = () => {
118120
data-tip="Clear selected rules"
119121
@click="clearRuleset"
120122
>
121-
<i class="ri-close-circle-fill text-secondary text-lg"></i>
123+
<i class="ri-close-circle-fill text-secondary text-lg" />
122124
</button>
123125
</div>
124126
<div

client/src/shims-vue.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module "*.vue" {
2+
import Vue from "vue";
3+
export default Vue;
4+
}

client/src/store/directoryStore.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export const calculateVisibleItems = () => {
6868
const listHeight = ref(0);
6969
const visibleItems = ref(0);
7070
// Determine the height of each list item
71-
const listItemHeight = listItems && listItems[0] ? listItems[0].clientHeight : 0;
71+
const listItemHeight =
72+
listItems && listItems[0] ? listItems[0].clientHeight : 0;
7273

7374
directoryData.value.childrenImages.forEach(() => {
7475
listHeight.value += listItemHeight;

0 commit comments

Comments
 (0)