diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8013360b..c518dc72 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,6 +9,25 @@ on: # branches: # - main jobs: + lint-client: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v7 + - name: Set up Node.js + uses: actions/setup-node@v7 + with: + node-version: "22" + - name: Enable Corepack + run: | + corepack enable + - name: Install client dependencies + working-directory: client + run: | + yarn install --immutable + - name: Type check, lint, and check formatting + working-directory: client + run: | + yarn lint:ci test: runs-on: ${{ matrix.os }} strategy: @@ -33,7 +52,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v7 with: - node-version: "20" + node-version: "22" - name: Enable Corepack run: | corepack enable @@ -47,9 +66,9 @@ jobs: - name: Build binary run: | tox -e binary - - name: Test binary runs + - name: Test binary run: | - dist/imagedephi --help + tox -e test-binary - name: Upload binary artifact uses: actions/upload-artifact@v7 with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b37b37d2..55c79f07 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,7 +28,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v7 with: - node-version: "20" + node-version: "22" - name: Enable Corepack run: | corepack enable diff --git a/client/package.json b/client/package.json index 11b897c9..fc8c561f 100644 --- a/client/package.json +++ b/client/package.json @@ -9,6 +9,9 @@ "lint:check": "eslint . --fix ", "lint:format": "prettier src --write", "lint": "npm-run-all lint:tsc lint:check lint:format", + "lint:ci:check": "eslint . --max-warnings 0", + "lint:ci:format": "prettier src --check", + "lint:ci": "npm-run-all lint:tsc lint:ci:check lint:ci:format", "dev": "NODE_ENV=development vite --port 8080", "build:clean": "rimraf ../imagedephi/web_static", "build:compile": "vite build --outDir ../imagedephi/web_static", diff --git a/client/src/HomePage.vue b/client/src/HomePage.vue index ec208b98..8ed5de99 100644 --- a/client/src/HomePage.vue +++ b/client/src/HomePage.vue @@ -24,7 +24,7 @@ const loadExportOptions = () => { if (saved) { return JSON.parse(saved); } - } catch (e) { + } catch { // Ignore parse errors } return null; @@ -33,7 +33,7 @@ const loadExportOptions = () => { const saveExportOptions = (options: Record) => { try { localStorage.setItem("imageDePhiExportOptions", JSON.stringify(options)); - } catch (e) { + } catch { // Ignore storage errors } }; @@ -44,9 +44,13 @@ const exportOptions = ref({ exportAssociated: savedOptions?.exportAssociated ?? false, }); -watch(exportOptions, (newVal) => { - saveExportOptions(newVal); -}, { deep: true }); +watch( + exportOptions, + (newVal) => { + saveExportOptions(newVal); + }, + { deep: true }, +); const progress = ref({ count: 0, @@ -181,23 +185,31 @@ onMounted(() => { help-text="Custom ruleset to be used for redaction in addition to the baserules." :ruleset-modal="rulesetModal || undefined" /> - -
+ +
{ :modal-id="'inputDirectory'" :title="'Input Directory'" @update-image-list=" - (redactionStateFlags.showImageTable = true), - (redactionStateFlags.redactionComplete = false) + ((redactionStateFlags.showImageTable = true), + (redactionStateFlags.redactionComplete = false)) " /> { type="submit" :class="`${!selectedDirectories.inputDirectory || !selectedDirectories.outputDirectory ? 'btn btn-block bg-accent text-white uppercase rounded-lg tooltip' : 'btn btn-block btn-accent text-white uppercase rounded-lg'}`" data-tip="Please select input and output directories" + :disabled=" + !selectedDirectories.inputDirectory || + !selectedDirectories.outputDirectory + " @click="canRedact()" - :disabled="!selectedDirectories.inputDirectory || !selectedDirectories.outputDirectory" > De-phi Images diff --git a/client/src/components/FileBrowser.vue b/client/src/components/FileBrowser.vue index f7c7bbed..2e909397 100644 --- a/client/src/components/FileBrowser.vue +++ b/client/src/components/FileBrowser.vue @@ -69,17 +69,17 @@ onBeforeUnmount(() => { class="btn btn-primary float-right text-white uppercase" type="button" @click=" - $emit('update-image-list'), - closeModal(), - title !== 'Output Directory' - ? updateTableData({ - directory: selectedDirectories.inputDirectory, - rules: selectedDirectories.rulesetDirectory, - limit: 50, - offset: 0, - update: false, - }) - : '' + ($emit('update-image-list'), + closeModal(), + title !== 'Output Directory' + ? updateTableData({ + directory: selectedDirectories.inputDirectory, + rules: selectedDirectories.rulesetDirectory, + limit: 50, + offset: 0, + update: false, + }) + : '') " > Select @@ -101,8 +101,8 @@ onBeforeUnmount(() => { v-else class="text-blue-700" @click=" - updateDirectories(ancestor.path), - updateSelectedDirectories(ancestor.path) + (updateDirectories(ancestor.path), + updateSelectedDirectories(ancestor.path)) " > {{ ancestor.name ? ancestor.name : "/" }} @@ -134,8 +134,8 @@ onBeforeUnmount(() => { :key="child.path" class="hover:bg-base-300 cursor-default py-0.5" @click=" - updateDirectories(child.path), - updateSelectedDirectories(child.path) + (updateDirectories(child.path), + updateSelectedDirectories(child.path)) " > @@ -179,17 +179,17 @@ onBeforeUnmount(() => {