[PR #5773] [MERGED] feat: migrate ESLint to v9 across packages #5344

Closed
opened 2026-03-17 02:47:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5773
Author: @jamesgeorge007
Created: 1/14/2026
Status: Merged
Merged: 1/20/2026
Merged by: @jamesgeorge007

Base: nextHead: feat/eslint-v9-migration


📝 Commits (3)

  • d9204bb feat: migrate ESLint from v8 to v9 across packages
  • 978d8c2 feat: extend eslint v9 to desktop, kernel, agent
  • 20230fb fix(agent): remaining eslint warnings and errors

📊 Changes

88 files changed (+3194 additions, -3234 deletions)

View changed files

packages/hoppscotch-agent/eslint.config.mjs (+67 -0)
📝 packages/hoppscotch-agent/package.json (+16 -1)
📝 packages/hoppscotch-agent/src/App.vue (+30 -18)
📝 packages/hoppscotch-agent/src/main.ts (+4 -6)
📝 packages/hoppscotch-agent/src/pages/otp.vue (+17 -11)
📝 packages/hoppscotch-agent/src/pages/registrations.vue (+20 -9)
packages/hoppscotch-common/.eslintrc.js (+0 -83)
packages/hoppscotch-common/eslint.config.mjs (+96 -0)
📝 packages/hoppscotch-common/package.json (+7 -4)
📝 packages/hoppscotch-common/src/components/accessTokens/index.vue (+3 -3)
📝 packages/hoppscotch-common/src/components/aiexperiments/MergeView.vue (+0 -1)
📝 packages/hoppscotch-common/src/components/app/spotlight/entry/GQLRequest.vue (+1 -1)
📝 packages/hoppscotch-common/src/components/app/spotlight/entry/RESTRequest.vue (+1 -1)
📝 packages/hoppscotch-common/src/components/collections/ImportExport.vue (+2 -2)
📝 packages/hoppscotch-common/src/components/collections/documentation/index.vue (+1 -1)
📝 packages/hoppscotch-common/src/components/collections/documentation/sections/RequestBody.vue (+2 -2)
📝 packages/hoppscotch-common/src/components/collections/documentation/sections/Response.vue (+2 -2)
📝 packages/hoppscotch-common/src/components/graphql/Query.vue (+3 -3)
📝 packages/hoppscotch-common/src/components/graphql/RequestOptions.vue (+2 -2)
📝 packages/hoppscotch-common/src/components/http/Request.vue (+1 -1)

...and 68 more files

📄 Description

This PR migrates the ESLint configuration across four packages from v8 to v9, adopting the new flat config format and updating all related tooling to ensure compatibility with the latest ESLint ecosystem.

Closes FE-1108.

ESLint v9 introduces significant improvements:

  • Flat config format - Simpler, more intuitive configuration.
  • Better performance - Faster linting with improved caching.
  • Enhanced type safety - Better TypeScript integration.
  • Modern defaults - Updated rule sets aligned with current best practices.
  • Future compatibility - Required for upcoming ESLint plugins and tooling.

Staying on v8 would eventually block us from:

  • Security updates and bug fixes.
  • New ESLint plugin versions.
  • Editor integration improvements.
  • CI/CD tooling updates.

What's Changed

  • Upgraded ESLint v8.57.0v9.39.2 across js-sandbox, common, desktop, and selfhost-web packages.
  • Replaced .eslintrc.js/.cjs files with eslint.config.mjs (flat config format using ES modules).
  • Using @vue/eslint-config-typescript v14's defineConfigWithVueTs API for Vue + TypeScript integration.
  • Added 3 rule disables to maintain v8 behavioural parity:
    • @typescript-eslint/no-unused-expressions - new rule in v14 that flags valid Vue expressions.
    • @typescript-eslint/no-unsafe-function-type - new rule flagging Function type usage.
    • @typescript-eslint/ban-types - maintains implicit v8 behavior.
  • Fixed ~50 unused catch variable warnings now correctly detected by v14's improved TypeScript parser (variables prefixed with _ when intentionally unused).
  • Simplified lint scripts: removed deprecated --ext and --ignore-path flags (flat config handles these automatically).
  • Remove stale @ts-expect-error directive usages.

Rule Preservation:
All existing lint rules remain unchanged. The @typescript-eslint/no-unused-vars rule is enabled with conditional severity and ignore patterns (argsIgnorePattern, varsIgnorePattern, caughtErrorsIgnorePattern), matching the v8 configuration exactly.

Config Format Change:
The flat config uses the defineConfigWithVueTs helper from @vue/eslint-config-typescript v14, which provides native ESLint 9 support without requiring compatibility layers:

// Old (.eslintrc.js)
module.exports = {
  extends: ["@vue/typescript/recommended", "plugin:vue/recommended"],
  rules: {...}
}

// New (eslint.config.mjs)
export default defineConfigWithVueTs(
  pluginVue.configs["flat/recommended"],
  vueTsConfigs.recommended,
  eslintPluginPrettierRecommended,
  { rules: {...} }
)

Testing:

  • All packages lint successfully with 0 errors
  • Pre-existing warnings remain (69 Vue prop warnings in common, 1 in desktop)
  • Pre-commit hooks pass

The migration preserves all existing lint rules and checking behaviour. This is a purely tooling upgrade with no changes to the code patterns flagged.

Note to reviewers

Please cross-check and confirm that there are no remaining reference errors, particularly in the usage of error arguments within catch blocks.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5773 **Author:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Created:** 1/14/2026 **Status:** ✅ Merged **Merged:** 1/20/2026 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `feat/eslint-v9-migration` --- ### 📝 Commits (3) - [`d9204bb`](https://github.com/hoppscotch/hoppscotch/commit/d9204bbbc4ceb6a00bac83782805c54f86dbab16) feat: migrate ESLint from v8 to v9 across packages - [`978d8c2`](https://github.com/hoppscotch/hoppscotch/commit/978d8c2bd5fafe7b1139d9aefd70ebe1f69c7021) feat: extend eslint v9 to desktop, kernel, agent - [`20230fb`](https://github.com/hoppscotch/hoppscotch/commit/20230fb1bfbc4867cc61314bd165f5095901f630) fix(agent): remaining eslint warnings and errors ### 📊 Changes **88 files changed** (+3194 additions, -3234 deletions) <details> <summary>View changed files</summary> ➕ `packages/hoppscotch-agent/eslint.config.mjs` (+67 -0) 📝 `packages/hoppscotch-agent/package.json` (+16 -1) 📝 `packages/hoppscotch-agent/src/App.vue` (+30 -18) 📝 `packages/hoppscotch-agent/src/main.ts` (+4 -6) 📝 `packages/hoppscotch-agent/src/pages/otp.vue` (+17 -11) 📝 `packages/hoppscotch-agent/src/pages/registrations.vue` (+20 -9) ➖ `packages/hoppscotch-common/.eslintrc.js` (+0 -83) ➕ `packages/hoppscotch-common/eslint.config.mjs` (+96 -0) 📝 `packages/hoppscotch-common/package.json` (+7 -4) 📝 `packages/hoppscotch-common/src/components/accessTokens/index.vue` (+3 -3) 📝 `packages/hoppscotch-common/src/components/aiexperiments/MergeView.vue` (+0 -1) 📝 `packages/hoppscotch-common/src/components/app/spotlight/entry/GQLRequest.vue` (+1 -1) 📝 `packages/hoppscotch-common/src/components/app/spotlight/entry/RESTRequest.vue` (+1 -1) 📝 `packages/hoppscotch-common/src/components/collections/ImportExport.vue` (+2 -2) 📝 `packages/hoppscotch-common/src/components/collections/documentation/index.vue` (+1 -1) 📝 `packages/hoppscotch-common/src/components/collections/documentation/sections/RequestBody.vue` (+2 -2) 📝 `packages/hoppscotch-common/src/components/collections/documentation/sections/Response.vue` (+2 -2) 📝 `packages/hoppscotch-common/src/components/graphql/Query.vue` (+3 -3) 📝 `packages/hoppscotch-common/src/components/graphql/RequestOptions.vue` (+2 -2) 📝 `packages/hoppscotch-common/src/components/http/Request.vue` (+1 -1) _...and 68 more files_ </details> ### 📄 Description This PR migrates the ESLint configuration across four packages from `v8` to `v9`, adopting the new flat config format and updating all related tooling to ensure compatibility with the latest ESLint ecosystem. Closes FE-1108. ESLint v9 introduces significant improvements: - **Flat config format** - Simpler, more intuitive configuration. - **Better performance** - Faster linting with improved caching. - **Enhanced type safety** - Better TypeScript integration. - **Modern defaults** - Updated rule sets aligned with current best practices. - **Future compatibility** - Required for upcoming ESLint plugins and tooling. Staying on v8 would eventually block us from: - Security updates and bug fixes. - New ESLint plugin versions. - Editor integration improvements. - CI/CD tooling updates. ### What's Changed - Upgraded ESLint `v8.57.0` → `v9.39.2` across `js-sandbox`, `common`, `desktop`, and `selfhost-web` packages. - Replaced `.eslintrc.js/.cjs` files with `eslint.config.mjs` (flat config format using ES modules). - Using `@vue/eslint-config-typescript v14`'s `defineConfigWithVueTs` API for Vue + TypeScript integration. - Added 3 rule disables to maintain `v8` behavioural parity: - `@typescript-eslint/no-unused-expressions` - new rule in `v14` that flags valid Vue expressions. - `@typescript-eslint/no-unsafe-function-type` - new rule flagging `Function` type usage. - `@typescript-eslint/ban-types` - maintains implicit `v8` behavior. - Fixed ~50 unused catch variable warnings now correctly detected by `v14`'s improved TypeScript parser (variables prefixed with `_` when intentionally unused). - Simplified lint scripts: removed deprecated `--ext` and `--ignore-path` flags (flat config handles these automatically). - Remove stale `@ts-expect-error` directive usages. **Rule Preservation:** All existing lint rules remain unchanged. The `@typescript-eslint/no-unused-vars` rule is enabled with conditional severity and ignore patterns (`argsIgnorePattern`, `varsIgnorePattern`, `caughtErrorsIgnorePattern`), matching the v8 configuration exactly. **Config Format Change:** The flat config uses the `defineConfigWithVueTs` helper from `@vue/eslint-config-typescript v14`, which provides native ESLint 9 support without requiring compatibility layers: ```javascript // Old (.eslintrc.js) module.exports = { extends: ["@vue/typescript/recommended", "plugin:vue/recommended"], rules: {...} } // New (eslint.config.mjs) export default defineConfigWithVueTs( pluginVue.configs["flat/recommended"], vueTsConfigs.recommended, eslintPluginPrettierRecommended, { rules: {...} } ) ``` **Testing:** - All packages lint successfully with **0 errors** - Pre-existing warnings remain (69 Vue prop warnings in common, 1 in desktop) - Pre-commit hooks pass > The migration preserves all existing lint rules and checking behaviour. This is a purely tooling upgrade with no changes to the code patterns flagged. ### Note to reviewers Please cross-check and confirm that there are no remaining reference errors, particularly in the usage of error arguments within catch blocks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:47:59 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5344
No description provided.