chore(lint): baseline root ESLint config + root lint script wired into CI (#16) - #233
Open
Vyacheslav-Tomashevskiy wants to merge 1 commit into
Conversation
…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.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16.
Problem
The root
eslint.config.jsexported a flat config with only anignoresentry — no rules, plugins, or language options — soeslint .at the repo root checked nothing. The rootlintscript (pnpm --recursive --stream lint) never linted root-level JS either, and CI only lints insidefrontend/. 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 afilesglob, with node globals declared.backend/,frontend/andcontract/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— rootlintscript is noweslint ., 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 committedpnpm-lock.yamlis unchanged and--frozen-lockfileinstalls keep working.CI wiring (
.github/workflows/frontend-ci-cd.yml)To make CI actually invoke root linting (
Files to touchitem), alint-rootjob should runpnpm run lintat the repo root and be added to theci-statusaggregate. I could not push this file myself — my git token intentionally lacks theworkflowscope, 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:Acceptance criteria
eslint .)pnpm run lint;lint-rootjob above)Verification (eslint 9)
eslint.config.jslints clean (exit 0).var/ unused var /==fails the run (exit 1).eslint.config.jsitself, so thelint-rootjob is green./claim #16
RTC payout address:
RTCd1554f0f35576faf01d386a6be1c947f560dd0b7