From 27b817f62747d72e44641d2f3029ecf1d33989ca Mon Sep 17 00:00:00 2001 From: James George <25279263+jamesgeorge007@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:48:55 +0530 Subject: [PATCH] feat: migrate ESLint to `v9` across packages (#5773) Co-authored-by: curiouscorrelation --- packages/hoppscotch-agent/eslint.config.mjs | 67 + packages/hoppscotch-agent/package.json | 17 +- packages/hoppscotch-agent/src/App.vue | 48 +- packages/hoppscotch-agent/src/main.ts | 10 +- packages/hoppscotch-agent/src/pages/otp.vue | 28 +- .../src/pages/registrations.vue | 29 +- packages/hoppscotch-common/.eslintrc.js | 83 - packages/hoppscotch-common/eslint.config.mjs | 96 + packages/hoppscotch-common/package.json | 11 +- .../src/components/accessTokens/index.vue | 6 +- .../components/aiexperiments/MergeView.vue | 1 - .../app/spotlight/entry/GQLRequest.vue | 2 +- .../app/spotlight/entry/RESTRequest.vue | 2 +- .../components/collections/ImportExport.vue | 4 +- .../collections/documentation/index.vue | 2 +- .../documentation/sections/RequestBody.vue | 4 +- .../documentation/sections/Response.vue | 4 +- .../src/components/graphql/Query.vue | 6 +- .../src/components/graphql/RequestOptions.vue | 4 +- .../src/components/http/Request.vue | 2 +- .../src/components/http/RequestOptions.vue | 4 +- .../src/components/http/ResponseInterface.vue | 2 +- .../ImportExportSteps/UrlImport.vue | 2 +- .../components/interceptors/agent/RootExt.vue | 4 +- .../components/mockServer/EditMockServer.vue | 2 +- .../mockServer/MockServerDashboard.vue | 2 +- .../src/components/settings/Agent.vue | 2 +- .../src/components/settings/AgentSubtitle.vue | 4 +- .../src/helpers/app/index.ts | 2 +- .../src/helpers/functional/object.ts | 2 +- .../src/helpers/functional/primtive.ts | 2 +- .../import-export/import/openapi/index.ts | 6 +- .../import/workers/openapi-import-worker.ts | 5 +- .../src/helpers/isValidUser.ts | 2 +- .../src/helpers/jsonParse.ts | 2 +- .../src/helpers/jsoncParse.ts | 2 +- .../src/helpers/lenses/jsonLens.ts | 2 +- .../hoppscotch-common/src/helpers/network.ts | 2 +- .../src/helpers/newOutline.ts | 2 +- .../src/helpers/realtime/MQTTConnection.ts | 4 +- .../hoppscotch-common/src/helpers/ternlint.js | 2 +- .../src/helpers/utils/uri.js | 2 +- .../src/newstore/mockServers.ts | 2 +- .../src/newstore/settings.ts | 2 +- .../platform/std/interceptors/agent/index.ts | 4 +- .../src/platform/std/interceptors/helpers.ts | 4 +- .../menu/__tests__/url.menu.spec.ts | 2 +- .../services/context-menu/menu/url.menu.ts | 2 +- .../src/services/oauth/flows/authCode.ts | 2 +- .../src/services/persistence/index.ts | 36 +- .../searchers/collections.searcher.ts | 2 +- .../searchers/teamRequest.searcher.ts | 2 +- .../test-runner/test-runner.service.ts | 2 +- packages/hoppscotch-desktop/.eslintrc.cjs | 67 - packages/hoppscotch-desktop/eslint.config.mjs | 79 + packages/hoppscotch-desktop/package.json | 51 +- .../hoppscotch-desktop/src/components.d.ts | 5 +- packages/hoppscotch-js-sandbox/.eslintrc.cjs | 42 - .../hoppscotch-js-sandbox/eslint.config.cjs | 70 + packages/hoppscotch-js-sandbox/package.json | 9 +- packages/hoppscotch-kernel/eslint.config.mjs | 52 + packages/hoppscotch-kernel/package.json | 12 +- packages/hoppscotch-kernel/src/index.ts | 44 +- .../src/io/impl/desktop/index.ts | 2 +- .../src/io/impl/desktop/v/1.ts | 18 +- .../src/io/impl/web/index.ts | 2 +- .../hoppscotch-kernel/src/io/impl/web/v/1.ts | 167 +- packages/hoppscotch-kernel/src/io/index.ts | 6 +- packages/hoppscotch-kernel/src/io/v/1.ts | 19 +- .../src/relay/impl/desktop/index.ts | 2 +- .../src/relay/impl/desktop/v/1.ts | 388 +-- .../src/relay/impl/web/index.ts | 2 +- .../src/relay/impl/web/v/1.ts | 2 +- packages/hoppscotch-kernel/src/relay/index.ts | 8 +- packages/hoppscotch-kernel/src/relay/v/1.ts | 1232 +++++----- .../src/store/impl/desktop/index.ts | 2 +- .../src/store/impl/desktop/v/1.ts | 680 +++--- .../src/store/impl/web/index.ts | 2 +- .../src/store/impl/web/v/1.ts | 516 ++-- packages/hoppscotch-kernel/src/store/index.ts | 8 +- packages/hoppscotch-kernel/src/store/v/1.ts | 129 +- .../hoppscotch-kernel/src/util/capability.ts | 7 +- .../hoppscotch-selfhost-web/.eslintrc.cjs | 73 - .../hoppscotch-selfhost-web/eslint.config.mjs | 85 + packages/hoppscotch-selfhost-web/package.json | 11 +- .../src/platform/auth/desktop/index.ts | 4 +- .../src/platform/auth/web/index.ts | 4 +- pnpm-lock.yaml | 2141 +++++++---------- 88 files changed, 3223 insertions(+), 3263 deletions(-) create mode 100644 packages/hoppscotch-agent/eslint.config.mjs delete mode 100644 packages/hoppscotch-common/.eslintrc.js create mode 100644 packages/hoppscotch-common/eslint.config.mjs delete mode 100644 packages/hoppscotch-desktop/.eslintrc.cjs create mode 100644 packages/hoppscotch-desktop/eslint.config.mjs delete mode 100644 packages/hoppscotch-js-sandbox/.eslintrc.cjs create mode 100644 packages/hoppscotch-js-sandbox/eslint.config.cjs create mode 100644 packages/hoppscotch-kernel/eslint.config.mjs delete mode 100644 packages/hoppscotch-selfhost-web/.eslintrc.cjs create mode 100644 packages/hoppscotch-selfhost-web/eslint.config.mjs diff --git a/packages/hoppscotch-agent/eslint.config.mjs b/packages/hoppscotch-agent/eslint.config.mjs new file mode 100644 index 00000000..1ca0349d --- /dev/null +++ b/packages/hoppscotch-agent/eslint.config.mjs @@ -0,0 +1,67 @@ +import pluginVue from "eslint-plugin-vue" +import { + defineConfigWithVueTs, + vueTsConfigs, +} from "@vue/eslint-config-typescript" +import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended" +import globals from "globals" + +export default defineConfigWithVueTs( + { + ignores: [ + "**/*.d.ts", + "dist/**", + "node_modules/**", + "src-tauri/**", + ], + }, + pluginVue.configs["flat/recommended"], + vueTsConfigs.recommended, + eslintPluginPrettierRecommended, + { + files: ["**/*.ts", "**/*.js", "**/*.vue"], + linterOptions: { + reportUnusedDisableDirectives: false, + }, + languageOptions: { + sourceType: "module", + ecmaVersion: "latest", + globals: { + ...globals.browser, + ...globals.node, + }, + parserOptions: { + requireConfigFile: false, + ecmaFeatures: { + jsx: false, + }, + }, + }, + rules: { + semi: [2, "never"], + "no-console": "off", + "no-debugger": process.env.HOPP_LINT_FOR_PROD === "true" ? "error" : "warn", + "prettier/prettier": + process.env.HOPP_LINT_FOR_PROD === "true" ? "error" : "warn", + "vue/multi-word-component-names": "off", + "vue/no-side-effects-in-computed-properties": "off", + "@typescript-eslint/no-unused-vars": [ + process.env.HOPP_LINT_FOR_PROD === "true" ? "error" : "warn", + { + args: "all", + argsIgnorePattern: "^_", + caughtErrors: "all", + caughtErrorsIgnorePattern: "^_", + destructuredArrayIgnorePattern: "^_", + varsIgnorePattern: "^_", + ignoreRestSiblings: true, + }, + ], + "@typescript-eslint/no-unused-expressions": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-function-type": "off", + "no-undef": "off", + }, + } +) diff --git a/packages/hoppscotch-agent/package.json b/packages/hoppscotch-agent/package.json index 3d6e0c4f..2a680c42 100644 --- a/packages/hoppscotch-agent/package.json +++ b/packages/hoppscotch-agent/package.json @@ -7,7 +7,14 @@ "dev": "vite", "build": "vue-tsc --noEmit && vite build", "preview": "vite preview", - "tauri": "tauri" + "tauri": "tauri", + "lint": "eslint src", + "lint:ts": "vue-tsc --noEmit", + "lintfix": "eslint --fix src", + "prod-lint": "cross-env HOPP_LINT_FOR_PROD=true pnpm run lint", + "do-lint": "pnpm run prod-lint", + "do-typecheck": "pnpm run lint:ts", + "do-lintfix": "pnpm run lintfix" }, "dependencies": { "@hoppscotch/ui": "0.2.5", @@ -24,8 +31,16 @@ "@tauri-apps/cli": "2.9.3", "@types/lodash-es": "4.17.12", "@types/node": "24.10.1", + "@typescript-eslint/eslint-plugin": "8.50.0", + "@typescript-eslint/parser": "8.50.0", "@vitejs/plugin-vue": "6.0.3", + "@vue/eslint-config-typescript": "14.6.0", "autoprefixer": "10.4.23", + "cross-env": "10.1.0", + "eslint": "9.39.2", + "eslint-plugin-prettier": "5.5.4", + "eslint-plugin-vue": "10.6.2", + "globals": "16.5.0", "postcss": "8.5.6", "tailwindcss": "3.4.16", "typescript": "5.9.3", diff --git a/packages/hoppscotch-agent/src/App.vue b/packages/hoppscotch-agent/src/App.vue index b54b57f6..ee370573 100644 --- a/packages/hoppscotch-agent/src/App.vue +++ b/packages/hoppscotch-agent/src/App.vue @@ -5,21 +5,33 @@ @@ -47,12 +59,12 @@ /> - + @@ -65,9 +77,9 @@ import { HoppButtonSecondary, HoppSmartTable, } from "@hoppscotch/ui" -// @ts-ignore +// @ts-expect-error - Icon import has no types import IconCopy from "~icons/lucide/copy" -// @ts-ignore +// @ts-expect-error - Icon import has no types import IconCheck from "~icons/lucide/check" import { useClipboard, refAutoReset } from "@vueuse/core" import { getCurrentWindow } from "@tauri-apps/api/window" @@ -183,7 +195,7 @@ onMounted(async () => { if (otp) { appState.value = { ...state(), otp: O.some(otp) } } else { - updateRegistrations(); + updateRegistrations() } }) )() @@ -204,12 +216,12 @@ onMounted(async () => { getOtp, TE.map((otp: string) => { if (otp) { - appState.value = { ...state(), otp: O.some(otp) }; + appState.value = { ...state(), otp: O.some(otp) } } else { - updateRegistrations(); + updateRegistrations() } }) - )(); + )() }), ]) }) diff --git a/packages/hoppscotch-agent/src/main.ts b/packages/hoppscotch-agent/src/main.ts index 9380216e..a1a836ca 100644 --- a/packages/hoppscotch-agent/src/main.ts +++ b/packages/hoppscotch-agent/src/main.ts @@ -1,6 +1,6 @@ -import { createApp } from 'vue' -import App from './App.vue' -import './index.css' +import { createApp } from "vue" +import App from "./App.vue" +import "./index.css" import { plugin as HoppUI } from "@hoppscotch/ui" @@ -8,6 +8,4 @@ import "@hoppscotch/ui/themes.css" import "@hoppscotch/ui/style.css" -createApp(App) - .use(HoppUI) - .mount('#app') +createApp(App).use(HoppUI).mount("#app") diff --git a/packages/hoppscotch-agent/src/pages/otp.vue b/packages/hoppscotch-agent/src/pages/otp.vue index 8d6ef7de..dfee5bb2 100644 --- a/packages/hoppscotch-agent/src/pages/otp.vue +++ b/packages/hoppscotch-agent/src/pages/otp.vue @@ -3,17 +3,21 @@

Agent Registration Request

- An app is trying to register against the Hoppscotch Agent. If this was intentional, copy the given code into - the app to complete the registration process. Please hide the window if you did not initiate this request. - Do not hide this window until the verification code is entered. The window will hide automatically once done. + An app is trying to register against the Hoppscotch Agent. If this was + intentional, copy the given code into the app to complete the + registration process. Please hide the window if you did not initiate + this request. Do not hide this window until the verification code is + entered. The window will hide automatically once done. +

+

+ {{ otpCode }}

-

{{ otpCode }}

Waiting for registration requests...

-

You can hide this window and access it again from the tray icon.

+

+ You can hide this window and access it again from the tray icon. +

-