mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
Wires JavaScript linting into the project for the first time, scoped to the Playwright specs and persona helpers under `roles/**/files/**/*.js`. Setup ----- - `package.json` + `package-lock.json` pin eslint v9, eslint-plugin- playwright v2, @eslint/js, globals. - `eslint.config.js` (flat config) loads `eslint:recommended` and `playwright/flat/recommended`. Browser globals are injected so `page.evaluate(() => window.foo)` callbacks lint cleanly. Project- idiomatic patterns are explicitly turned off with rationale: the service-gating contract (req 006/019) uses test.skip on disabled services; persona helpers branch on isVisible/isServiceEnabled before expect; some specs deliberately use waitForTimeout / networkidle for OIDC settle. `no-empty` allows the empty-catch idiom; the autofixer for `prefer-web-first-assertions` and `no-wait-for-navigation` is unsafe in this codebase (broken diff in dashboard.js), so both are off pending a hand-migration pass. - `scripts/lint/javascript.sh` mirrors the markdown.sh shape (skip on missing, exit 127 with "make install-lint" hint). - `scripts/lint/autoformat.sh` gets a `run_eslint` worker (treats rc≤1 as OK, like markdownlint). - `scripts/install/lint.sh` gets `ensure_eslint` (npm-local install in the repo root, matching the markdownlint pattern), a `javascript` group, and `install_javascript_tools` is wired into the `all` group. - `Makefile` exposes `lint-javascript` and folds it into the aggregate `lint` target. - `.github/workflows/lint-javascript.yml` follows the lint-makefile.yml shape (Node 20, npm cache, `npm ci`, `make lint-javascript`); the ci-orchestrator wires it into the lint pipeline + lint-gate `needs:`. - `.gitignore` adds `node_modules/`. Real lint findings fixed in this commit --------------------------------------- - `roles/web-app-decidim/files/playwright.spec.js` was using `runBiberFlow` / `runAdminFlow` without ever requiring `./personas` (would have failed at runtime). Adds the require. - Same file: two nutzlose `\\'csrf-token\\'` escapes in a double-quoted query selector — eslint flagged, fixed. - `roles/web-app-moodle/files/playwright.spec.js`: `expect(await locator.count()).toBe(0)` → `await expect(locator).toHaveCount(0)` (Playwright auto-retrying assertion; safe `prefer-to-have-count` autofix). Lint baseline: 0 errors, 285 warnings (mostly `no-unused-vars` and `playwright/expect-expect` — addressable as follow-up cleanup, not blocking). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
17 lines
409 B
JSON
17 lines
409 B
JSON
{
|
|
"name": "infinito-nexus-js-lint",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"description": "JavaScript lint dependencies for infinito-nexus (Playwright specs + persona helpers).",
|
|
"scripts": {
|
|
"lint": "eslint",
|
|
"lint:fix": "eslint --fix"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.17.0",
|
|
"eslint": "^9.17.0",
|
|
"eslint-plugin-playwright": "^2.1.0",
|
|
"globals": "^15.14.0"
|
|
}
|
|
}
|