diff --git a/assets/js/shortcuts.ts b/assets/js/shortcuts.ts index dc7d920f..ac0745d8 100644 --- a/assets/js/shortcuts.ts +++ b/assets/js/shortcuts.ts @@ -47,31 +47,16 @@ function isOK(event: KeyboardEvent): boolean { ); } +/* eslint-disable prettier/prettier */ const keyCodes: ShortcutKeyMap = { - j() { - click('.js-prev'); - }, // J - go to previous image - i() { - click('.js-up'); - }, // I - go to index page - k() { - click('.js-next'); - }, // K - go to next image - r() { - click('.js-rand'); - }, // R - go to random image - s() { - click('.js-source-link'); - }, // S - go to image source - l() { - click('.js-tag-sauce-toggle'); - }, // L - edit tags - o() { - openFullView(); - }, // O - open original - v() { - openFullViewNewTab(); - }, // V - open original in a new tab + j() { click('.js-prev'); }, // J - go to previous image + i() { click('.js-up'); }, // I - go to index page + k() { click('.js-next'); }, // K - go to next image + r() { click('.js-rand'); }, // R - go to random image + s() { click('.js-source-link'); }, // S - go to image source + l() { click('.js-tag-sauce-toggle'); }, // L - edit tags + o() { openFullView(); }, // O - open original + v() { openFullViewNewTab(); }, // V - open original in a new tab f() { // F - favourite image click(getHover() ? `a.interaction--fave[data-image-id="${getHover()}"]` : '.block__header a.interaction--fave'); @@ -81,6 +66,7 @@ const keyCodes: ShortcutKeyMap = { click(getHover() ? `a.interaction--upvote[data-image-id="${getHover()}"]` : '.block__header a.interaction--upvote'); }, }; +/* eslint-enable prettier/prettier */ export function listenForKeys() { document.addEventListener('keydown', (event: KeyboardEvent) => { diff --git a/assets/package-lock.json b/assets/package-lock.json index a16baf7c..cd0063c5 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -24,7 +24,6 @@ "@vitest/coverage-v8": "^1.6.0", "chai": "^5", "eslint": "^9.4.0", - "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-vitest": "^0.5.4", "jest-environment-jsdom": "^29.7.0", @@ -2791,6 +2790,8 @@ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, + "optional": true, + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" },