Skip to content

[BUG] engine-bridge npm run lint references eslint, which is neither installed nor configured #160

Description

@N-thnI

Status: ✅ Resolved on main — fixed by PR #157, commit 7073d25. Verified against a freshly-fetched origin/main before editing this issue.

Description

engine-bridge/package.json defined "lint": "eslint src --ext .ts", but eslint was not listed in devDependencies and no ESLint config file existed anywhere in engine-bridge/. npm run lint could not succeed as shipped.

Affected Component

engine-bridge/package.json, engine-bridge/.eslintrc.cjs (missing)

Original Behavior (Bug)

npm run lint failed to resolve the eslint binary since it was never installed, and even if manually installed, there was no config telling it how to parse TypeScript.

Expected Behavior

npm run lint runs ESLint against src/**/*.ts using a real TypeScript-aware config and exits 0 on clean code / non-zero on violations.

Root Cause

The lint script was added to package.json without adding the corresponding tooling — likely copy-pasted from dashboard/package.json, which has both eslint and a working .eslintrc.cjs.

Resolution

Two changes landed together:

  1. Added eslint@^8.57.0, @typescript-eslint/parser@^8.61.1, @typescript-eslint/eslint-plugin@^8.61.1 to devDependencies.
  2. Added engine-bridge/.eslintrc.cjs:
    module.exports = {
      root: true,
      env: { node: true, es2022: true },
      parser: '@typescript-eslint/parser',
      parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
      plugins: ['@typescript-eslint'],
      extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
      rules: {
        '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
        '@typescript-eslint/no-explicit-any': 'warn',
        'no-constant-condition': ['error', { checkLoops: false }],
        'prefer-const': ['error', { destructuring: 'all' }],
      },
      ignorePatterns: ['dist', 'node_modules', 'coverage'],
    };
    The two rule overrides at the bottom aren't stylistic taste — they fix real false positives found while first running lint against src/: no-constant-condition was flagging intentional while (true) { ...; break; } polling loops in event-propagator.ts and tx-aggregator.ts (the default checkLoops: true doesn't distinguish a bounded poll-with-break from a genuine infinite loop), and prefer-const's default destructuring: 'any' was flagging path in let { queue, path } = ... even though queue in the same destructure legitimately gets reassigned later — destructuring: 'all' only requires const when every destructured binding is const-eligible.

Verification

$ git show origin/main:engine-bridge/package.json | grep -i eslint
"@typescript-eslint/eslint-plugin": "^8.61.1",
"@typescript-eslint/parser": "^8.61.1",
"eslint": "^8.57.0",

$ git cat-file -e origin/main:engine-bridge/.eslintrc.cjs && echo EXISTS
EXISTS

$ npm run lint
✖ 32 problems (0 errors, 32 warnings)
  • AC-1: npm run lint runs and exits 0 with 0 errors on current src/ (32 pre-existing no-explicit-any/unused-var warnings remain by design — style, not correctness — since @typescript-eslint/no-explicit-any is intentionally warn not error).
  • AC-2: Config is committed and consistent with dashboard's conventions (same parser, same plugin, same rule shape).

Definition of Done

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26bugSomething isn't workingengine-coreRust/Soroban engine-core crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions