Skip to content

[Bug] npm run lint crashes during typescript-eslint rule initialization #2

Description

@VickyKumarOfficial

Problem statement

The root lint command crashes while ESLint is loading @typescript-eslint/no-unused-expressions. It never reaches normal lint diagnostics, so contributors and CI cannot use lint as a quality gate.

Environment observed

  • Branch: main
  • Node.js: 22.17.1
  • ESLint: 9.33.0
  • typescript-eslint: 8.11.0
  • @typescript-eslint/eslint-plugin: 8.11.0

Steps to reproduce

  1. Install dependencies from the committed npm lockfile.
  2. From the repository root, run:
npm run lint
  1. The same failure can be isolated to tracked application paths with:
npx eslint src backend

Actual behavior

ESLint exits with code 1 before linting the codebase:

TypeError: Error while loading rule '@typescript-eslint/no-unused-expressions':
Cannot read properties of undefined (reading 'allowShortCircuit')
Occurred while linting src/App.tsx

Expected behavior

The lint command should inspect the configured source files, report actionable violations, and return a stable exit code without crashing inside a rule implementation.

Root-cause evidence

This dependency combination matches the upstream typescript-eslint extension-rule compatibility defect fixed in version 8.15.0:

typescript-eslint/typescript-eslint#10338

The current package range/lock state can resolve an affected 8.11.0 plugin alongside ESLint 9.x.

Proposed resolution

  1. Upgrade typescript-eslint and all direct @typescript-eslint/* packages together to a compatible release (8.15.0 or newer).
  2. Refresh and commit package-lock.json using the project's supported Node/npm version.
  3. Confirm there are no stale, mixed versions with npm ls typescript-eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser @typescript-eslint/utils eslint.
  4. Keep the rule enabled; do not mask the crash by disabling @typescript-eslint/no-unused-expressions.
  5. Pin or document the supported Node version if the dependency set requires it.

Acceptance criteria

  • npm ci completes from a clean checkout.
  • npm run lint completes without a rule-loader exception.
  • The lint command checks the intended tracked frontend/backend source paths.
  • npm run build still succeeds.
  • Updated dependency and lockfile versions are committed consistently.
  • Supported Node/npm versions are documented or pinned.

Verification checklist

npm ci
npm ls typescript-eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser @typescript-eslint/utils eslint
npm run lint
npm run build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions