Skip to content

chore: upgrade typescript-eslint to v8.46.2 and fix lint errors#7692

Closed
v-sohmondal wants to merge 1 commit intomainfrom
users/v-sohmondal/upgrade-typescript-eslint-v8
Closed

chore: upgrade typescript-eslint to v8.46.2 and fix lint errors#7692
v-sohmondal wants to merge 1 commit intomainfrom
users/v-sohmondal/upgrade-typescript-eslint-v8

Conversation

@v-sohmondal
Copy link
Copy Markdown
Contributor

Description

Upgraded @typescript-eslint/parser and @typescript-eslint/eslint-plugin to v8.46.2 to resolve version conflicts and enable stricter type-checking rules.

Dependency Updates:

  • @typescript-eslint/parser: v6.21.0 → v8.46.2
  • @typescript-eslint/eslint-plugin: v5.62.0 → v8.46.2

Configuration Changes (eslintrc.base.js):

  • Migrated to projectService: true (replaces deprecated project option)
  • Updated extends config: recommended-type-checked (renamed from recommended-requiring-type-checking)
  • Replaced deprecated @typescript-eslint/ban-types with @typescript-eslint/no-empty-object-type, @typescript-eslint/no-wrapper-object-types, and @typescript-eslint/no-unsafe-function-type
  • Replaced deprecated @typescript-eslint/no-var-requires with @typescript-eslint/no-require-imports
  • Added tsconfigRootDir: __dirname for proper path resolution
  • Updated ecmaVersion from 8 to 2020
  • Added override for .js files with disable-type-checked

Lint Error Fixes (68 errors across 48 files):

  • prefer-promise-reject-errors (29 fixes): Wrapped Promise.reject() values in Error objects
  • no-base-to-string (15 fixes): Added proper stringification using JSON.stringify() or type checking
  • no-unused-expressions (14 fixes): Added void operator for intentional side-effect expressions
  • no-redundant-type-constituents (6 fixes): Removed redundant type unions
  • no-unsafe-enum-comparison (3 fixes): Added type assertions for enum comparisons
  • only-throw-error (1 fix): Wrapped throw string in Error object

All errors were properly fixed without disabling any rules.

Details

This upgrade resolves conflicts introduced by Dependabot PRs #7686 and #7687, which attempted to upgrade the parser and plugin separately to different major versions. The v8 upgrade brings stricter type-checking that improves code quality.

Motivation

Addresses version mismatch between @typescript-eslint/parser (v6) and @typescript-eslint/eslint-plugin (v5), and enables modern typescript-eslint features and stricter type safety checks.

Context

No functionality is left out-of-scope. All 68 lint errors introduced by v8's stricter rules have been properly addressed without disabling any rules, ensuring improved code quality throughout the codebase.

Pull request checklist

- Upgraded @typescript-eslint/parser from v6.21.0 to v8.46.2
- Upgraded @typescript-eslint/eslint-plugin from v5.62.0 to v8.46.2
- Updated eslintrc.base.js configuration for v8 compatibility:
  - Changed parserOptions.project to projectService: true
  - Renamed recommended-requiring-type-checking to recommended-type-checked
  - Replaced deprecated rules (ban-types, no-var-requires)
  - Added override for JS files with disable-type-checked
  - Updated ecmaVersion from 8 to 2020

Fixed 68 lint errors introduced by stricter v8 rules:
- prefer-promise-reject-errors (29): Wrapped Promise.reject() calls with Error objects
- no-base-to-string (15): Added proper stringification for objects
- no-unused-expressions (14): Added void operator for intentional side-effect expressions
- no-redundant-type-constituents (6): Removed redundant type unions
- no-unsafe-enum-comparison (3): Added type assertions for enum comparisons
- only-throw-error (1): Wrapped error string in Error object
@v-sohmondal v-sohmondal deleted the users/v-sohmondal/upgrade-typescript-eslint-v8 branch October 22, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant