Skip to content

chore(lint): extend ESLint to electron and build scripts, fix existing errors - #34

Merged
rosspeili merged 1 commit into
ARPAHLS:mainfrom
AUDOSt0ck1ng:chore/lint-coverage
Aug 7, 2026
Merged

chore(lint): extend ESLint to electron and build scripts, fix existing errors#34
rosspeili merged 1 commit into
ARPAHLS:mainfrom
AUDOSt0ck1ng:chore/lint-coverage

Conversation

@AUDOSt0ck1ng

Copy link
Copy Markdown
Collaborator

Why

npm run lint only ever checked src/ plus the two root config files. The flat config had a single block matching **/*.{js,jsx}, so every electron/*.cjs file — main.cjs, preload.cjs, and the VRoid Hub modules — was parsed with zero rules applied, and scripts/*.mjs was never matched at all.

Linting was also red on main, which meant it could not be used as a merge gate. This PR is a prerequisite for the CI workflow requested in #4: without it, that workflow fails on its first run.

Config changes

  • Scope the renderer block to src/ (browser globals + React rules).
  • Add an electron/**/*.cjs block: commonjs, Node globals, recommended. The test suites need no extra globals — they require('node:test').
  • Add blocks for *.config.js and scripts/** with Node globals.
  • Move --max-warnings=0 into the lint script so local and CI agree.

Fixes surfaced by the wider net

  • VoicePanel.jsx — destructured an unused audioFile; the file input is uncontrolled and only needs the setter. Dropped the prop at the call site too.
  • VrmAvatar.jsx — read group.current in effect cleanup. Capture the group once and use it for both attach and detach, so a model swap detaches from the group it attached to. This one is an actual bug, not just a lint complaint.
  • scripts/make-icons.mjs — dropped a dead installerAssets array that duplicated the sizes already inlined in the PowerShell block: a trap if someone edited one and not the other.

Verification

Lint coverage goes from 40 to 55 files. npm run lint, npm run build, and the 26 electron/*.test.cjs tests all pass.

🤖 Generated with Claude Code

…g errors

`npm run lint` covered only src/ and the two root config files: the flat
config's single block matched `**/*.{js,jsx}`, so every `electron/*.cjs`
file — main, preload, and the VRoid Hub modules — was parsed with zero
rules applied, and `scripts/*.mjs` was never matched at all. Linting was
also red on main, so it could not be used as a gate.

Config:
- Scope the renderer block to `src/` (browser globals + React rules).
- Add an `electron/**/*.cjs` block: commonjs, Node globals, recommended.
  The suites need no extra globals — they require('node:test').
- Add blocks for `*.config.js` and `scripts/**` with Node globals.
- Move `--max-warnings=0` into the `lint` script so local and CI agree.

Fixes surfaced by the wider net:
- VoicePanel destructured an unused `audioFile`; the file input is
  uncontrolled and only needs the setter. Dropped the prop at the call
  site too.
- VrmAvatar read `group.current` in effect cleanup. Capture the group
  once and use it for both attach and detach, so a swap detaches from
  the group it attached to.
- make-icons dropped a dead `installerAssets` array that duplicated the
  sizes already inlined in the PowerShell block — a trap if someone
  edited one and not the other.

Coverage: 40 → 55 files. lint, build, and the 26 electron tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@rosspeili

Copy link
Copy Markdown
Contributor

Thanks @AUDOSt0ck1ng, this looks good to merge as a standalone PR.

Noted as a prerequisite for #4 / #35, those will follow after this lands and next review. No blockers from my side.

@rosspeili
rosspeili merged commit fbebd80 into ARPAHLS:main Aug 7, 2026
rosspeili added a commit to AUDOSt0ck1ng/avatar that referenced this pull request Aug 7, 2026
…PAHLS#34, ARPAHLS#35)

Record Unreleased notes for ESLint coverage and GitHub Actions CI, add the README CI badge, mark roadmap CI done, document the workflow in project layout, and expand CONTRIBUTING for changelog style, CI gates, and human/AI ripple-effect guidance.
rosspeili added a commit that referenced this pull request Aug 7, 2026
* ci: run lint, tests, and production build on PRs and main

Closes #4. Label sync was the only workflow, so renderer and Electron
regressions could land with no automated signal.

- Node 22 (Vite 7 needs ^20.19.0 || >=22.12.0), npm cache keyed on
  avatar/package-lock.json.
- Runs `npm test` as well as lint and build: the 26 Electron unit tests
  existed but nothing ever ran them.
- Skips the Electron binary download — the tested modules deliberately
  avoid require('electron'), so ~100 MB is dead weight here.
- No dist:win: Windows-specific and slow, deferred as the issue suggests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* ci: bump checkout and setup-node to v5

v4 declares the node20 runtime, which GitHub now force-runs on Node 24
and warns about on every run. v5 declares node24 natively. No input
changes: node-version, cache, and cache-dependency-path are unchanged
between v4 and v5.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: changelog, CI badge, and CONTRIBUTING ripples for lint + CI (#34, #35)

Record Unreleased notes for ESLint coverage and GitHub Actions CI, add the README CI badge, mark roadmap CI done, document the workflow in project layout, and expand CONTRIBUTING for changelog style, CI gates, and human/AI ripple-effect guidance.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: rosspeili <vpeilivanidis@gmail.com>
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.

2 participants