Skip to content

chore: add ESLint, CodeQL, and npm audit to CI#180

Open
jakebromberg wants to merge 4 commits intomainfrom
chore/static-analysis
Open

chore: add ESLint, CodeQL, and npm audit to CI#180
jakebromberg wants to merge 4 commits intomainfrom
chore/static-analysis

Conversation

@jakebromberg
Copy link
Member

@jakebromberg jakebromberg commented Feb 12, 2026

Closes #238

Summary

  • ESLint with eslint-config-next (core-web-vitals + typescript presets) via flat config (eslint.config.mjs)
  • CI workflow (.github/workflows/ci.yml) with lint, typecheck, and npm audit --audit-level=high steps
  • CodeQL workflow (.github/workflows/codeql.yml) with security-extended queries and weekly scheduled scans
  • Fix ~200 lint violations across the codebase (unused vars/imports, console.log, unescaped entities, missing alt text, exhaustive-deps, no-explicit-any suppressions for SDK types, etc.)
  • Add npm run lint / npm run lint:fix scripts
  • Fix high-severity npm audit finding (@isaacs/brace-expansion)

Notable decisions

  • React Compiler rules disabled: react-hooks v7 (shipped with eslint-config-next 16) includes new rules (set-state-in-effect, refs, purity, preserve-manual-memoization) that are too strict for the current codebase. Disabled until React Compiler is adopted.
  • no-explicit-any suppressed for SDK types: ~49 instances where any is required due to better-auth SDK missing types, RTK Query untyped backend responses, and vendor-prefixed browser APIs. Each has a justification comment.
  • @next/next/no-img-element suppressed for external image URLs (album art from Discogs/iTunes/Last.fm) where next/image remote patterns aren't practical.

Test plan

  • npx eslint . -- 0 errors, 0 warnings
  • npm run build -- passes
  • npm audit --audit-level=high -- exit code 0
  • npm run test:run -- pre-existing failures only (unchanged)
  • npx tsc --noEmit -- pre-existing failures only (unchanged)

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 12, 2026

Deploying wxyc-dj with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1e45da0
Status: ✅  Deploy successful!
Preview URL: https://22327451.dj-site.pages.dev
Branch Preview URL: https://chore-static-analysis.dj-site.pages.dev

View logs

@jakebromberg jakebromberg reopened this Feb 26, 2026
@jakebromberg jakebromberg force-pushed the chore/static-analysis branch 2 times, most recently from 262779f to 95234e0 Compare February 26, 2026 22:49
Jake Bromberg added 4 commits February 27, 2026 14:20
Set up ESLint with eslint-config-next (core-web-vitals + typescript),
CodeQL for security scanning, and npm audit for dependency
vulnerabilities. Fix all lint violations across the codebase.

- Add eslint.config.mjs with flat config format
- Add CI workflow with lint, typecheck, and audit steps
- Add CodeQL workflow with weekly scheduled scans
- Fix ~200 lint violations (unused vars/imports, console.log,
  unescaped entities, missing alt text, exhaustive-deps, etc.)
- Add eslint-disable comments for SDK-related any casts
- Disable React Compiler rules pending adoption
Run npm audit fix to update transitive dependencies:
- minimatch 3.1.2 -> 3.1.5, 8.0.4 -> 8.0.7, 9.0.5 -> 9.0.8 (ReDoS)
- rollup 4.57.1 -> 4.59.0 (path traversal)
- fast-xml-parser 5.3.4 -> 5.3.6 via @aws-sdk/xml-builder (DoS, entity bypass)
- ajv 6.12.6 -> 6.14.0 (ReDoS)

Remaining 9 vulnerabilities are low/moderate with no non-breaking fix.
The @wxyc/shared package is hosted on GitHub Packages, which requires
authentication. Add registry-url and NPM_TOKEN env vars to the CI
workflow, matching the pattern used in PR #224.
- Replace `Function` type with explicit parameter types in rightbar test
- Replace `any` with typed parameters in organization-utils.ts
- Replace `any` cast with typed object in conversions.ts default case
- Fix `play_freq` -> `rotation_bin` rename in BinContent test
- Fix `SearchIn` value "Both" -> "All" in catalogSearchQuery test
- Fix mock return types to match async signatures in test files
- Add required fields to mock objects for type compatibility
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.

No automated static analysis or security scanning in CI

2 participants