Skip to content

chore(lint): baseline root ESLint config + root lint script wired into CI (#16) - #233

Open
Vyacheslav-Tomashevskiy wants to merge 1 commit into
vespera-labs:mainfrom
Vyacheslav-Tomashevskiy:fix/root-eslint-baseline-16
Open

chore(lint): baseline root ESLint config + root lint script wired into CI (#16)#233
Vyacheslav-Tomashevskiy wants to merge 1 commit into
vespera-labs:mainfrom
Vyacheslav-Tomashevskiy:fix/root-eslint-baseline-16

Conversation

@Vyacheslav-Tomashevskiy

@Vyacheslav-Tomashevskiy Vyacheslav-Tomashevskiy commented Jul 2, 2026

Copy link
Copy Markdown

Closes #16.

Problem

The root eslint.config.js exported a flat config with only an ignores entry — no rules, plugins, or language options — so eslint . at the repo root checked nothing. The root lint script (pnpm --recursive --stream lint) never linted root-level JS either, and CI only lints inside frontend/. Root config/tooling files were completely unlinted.

Changes in this PR

  • eslint.config.js — added a dependency-free baseline ruleset (no-unused-vars, no-undef, no-var, prefer-const, eqeqeq) scoped to root-level JS via a files glob, with node globals declared. backend/, frontend/ and contract/ are ignored so the root pass never double-lints sub-packages that own their own ESLint configs and lint steps (per the Out of scope note).
  • package.json — root lint script is now eslint ., so it lints root-level JS and exits non-zero on violations.

No new dependencies are added: the config uses only the already-installed eslint, so the committed pnpm-lock.yaml is unchanged and --frozen-lockfile installs keep working.

CI wiring (.github/workflows/frontend-ci-cd.yml)

To make CI actually invoke root linting (Files to touch item), a lint-root job should run pnpm run lint at the repo root and be added to the ci-status aggregate. I could not push this file myself — my git token intentionally lacks the workflow scope, so GitHub rejects PAT pushes that touch .github/workflows/. I've enabled maintainer can modify; the exact change is below and I'm happy to have it applied to the branch:

# add after the lint-and-test job:
  lint-root:
    name: Root ESLint
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Setup pnpm
        uses: pnpm/action-setup@v4
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "pnpm"
          cache-dependency-path: "./pnpm-lock.yaml"
      - name: Install root dependencies
        run: pnpm install --frozen-lockfile
      - name: Run root ESLint
        run: pnpm run lint

# and add lint-root to the ci-status aggregate:
#   needs: [lint-and-test, lint-root, build]
#   for job in lint-and-test lint-root build; do

Acceptance criteria

  • Root ESLint config applies a baseline rule set to root-level JS files
  • A root lint script exists and exits non-zero on violations (eslint .)
  • Approach consistent with how CI invokes linting (pnpm run lint; lint-root job above)
  • No package's existing lint behavior is broken (sub-packages ignored; their own lint steps untouched)

Verification (eslint 9)

  • eslint.config.js lints clean (exit 0).
  • A root JS file with var / unused var / == fails the run (exit 1).
  • Files under the ignored sub-package dirs are skipped.
  • The only root-level JS file in the repo is eslint.config.js itself, so the lint-root job is green.

/claim #16

RTC payout address: RTCd1554f0f35576faf01d386a6be1c947f560dd0b7

…pera-labs#16)

The root eslint.config.js only set `ignores` with no rules, so `eslint .`
at the repo root checked nothing, and the root `lint` script recursed into
package scripts without ever linting root-level JS.

- eslint.config.js: add a dependency-free baseline (no-unused-vars, no-undef,
  no-var, prefer-const, eqeqeq) scoped to root-level JS via a files glob, with
  node globals declared. backend/, frontend/ and contract/ are ignored so the
  root pass never double-lints sub-packages that own their own configs.
- package.json: root `lint` script is now `eslint .` — it lints root-level JS
  and exits non-zero on violations.

No new dependencies (uses the already-installed eslint), so the committed
pnpm-lock.yaml is unchanged. Verified with eslint 9: the config file lints
clean and a violation in a root JS file fails the run.
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.

[Infra] Root eslint.config.js only sets ignores and lints nothing

1 participant