Skip to content

Add ESLint with CI enforcement#10

Merged
ambv merged 7 commits intomainfrom
frontend-eslint
Mar 16, 2026
Merged

Add ESLint with CI enforcement#10
ambv merged 7 commits intomainfrom
frontend-eslint

Conversation

@ambv
Copy link
Contributor

@ambv ambv commented Mar 16, 2026

We'll be adding more bona fide tests to the three components of the system, but let's at least start with sensible linting. Frontend first.

ambv and others added 5 commits March 16, 2026 13:41
The frontend had an .eslintrc.json config extending next/core-web-vitals
and next/typescript, but the actual eslint packages were never listed
in package.json. This meant `npm run lint` always failed.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Remove unused imports. Replace empty interfaces with type aliases.
Fix a const used only as a type. Export DialogClose so it's not
flagged as unused.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Remove unused imports. Drop bindings from catch clauses where the
error variable was unused. Remove dead API_BASE assignments.
Replace require() calls with dynamic import() in QueryConsole.
Escape apostrophes in JSX text.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Remove unused imports and variables. Drop bindings from catch clauses.
Use const where variables are never reassigned. Remove unused map
callback parameters. Escape apostrophes in JSX text.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace the dummy CI workflow with one that runs ESLint and tsc on
every push and PR. Document how to run both checks via Docker.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds frontend ESLint + CI enforcement and updates existing frontend code to comply with lint/typecheck rules.

Changes:

  • Add ESLint dependencies to the frontend and enforce lint + typecheck in GitHub Actions CI.
  • Clean up frontend code to satisfy linting (unused imports/vars, prefer-const, JSX apostrophe escaping, etc.).
  • Minor type/style refactors (e.g., type aliases, additional UI exports).

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/src/types/components.ts Removes unused type imports to satisfy linting.
frontend/src/types/api.ts Changes TrendQueryParams to a type alias for backward compatibility.
frontend/src/lib/api.ts Removes unused imported API types.
frontend/src/hooks/use-toast.ts Refactors action type definitions to avoid unused constants.
frontend/src/components/ui/textarea.tsx Simplifies props type to a type alias.
frontend/src/components/ui/dialog.tsx Exports DialogClose from the dialog UI module.
frontend/src/components/ui/collapsible.tsx Removes unused React import.
frontend/src/components/diff/CommitTooltipContent.tsx Removes unused UI imports.
frontend/src/app/version-comparison/page.tsx Removes unused imports/variables; escapes apostrophes for JSX.
frontend/src/app/trends/page.tsx Applies prefer-const in key parsing logic.
frontend/src/app/page.tsx Removes unused index parameter in .map.
frontend/src/app/diff/page.tsx Removes unused imports/helpers; minor whitespace cleanup.
frontend/src/app/build-comparison/page.tsx Lint-driven refactors (consts, escaping); adjusts memoization usage.
frontend/src/app/binaries/[id]/page.tsx Prefixes unused prop with _ to satisfy no-unused-vars rule.
frontend/src/app/admin/page.tsx Removes unused constants/imports; simplifies catch blocks.
frontend/src/app/admin/components/TokensManager.tsx Simplifies catch blocks; escapes apostrophes in UI text.
frontend/src/app/admin/components/QueryConsole.tsx Reworks dynamic imports; removes unused imports; formatting cleanup.
frontend/src/app/admin/components/MemrayFailuresManager.tsx Removes unused API_BASE.
frontend/src/app/admin/components/EnvironmentsManager.tsx Simplifies catch blocks; formatting cleanup.
frontend/src/app/admin/components/BinariesManager.tsx Removes unused imports; simplifies catch blocks.
frontend/src/app/admin/components/BenchmarkResultsManager.tsx Removes unused icon imports; simplifies catch blocks; formatting cleanup.
frontend/src/app/admin/components/AdminUsersManager.tsx Removes unused imports/types; formatting cleanup.
frontend/src/app/about/page.tsx Simplifies catch blocks; escapes apostrophes; removes unused index.
frontend/package.json Adds eslint and eslint-config-next devDependencies.
docker-README.md Documents linting and typecheck commands via Docker.
README.md Updates testing instructions and notes CI enforcement.
.github/workflows/ci.yml Replaces dummy CI with frontend lint + typecheck job.
Comments suppressed due to low confidence (1)

frontend/src/app/build-comparison/page.tsx:316

  • This useMemo computes and returns an array but the return value is discarded (not assigned/used). This still runs the expensive aggregation/sort work when deps change, but has no effect on rendering. Either remove this hook entirely, or assign it to a variable and use it (or switch to useEffect if side effects are intended).
  useMemo(() => {
    // For "All Benchmarks" mode, don't require selectedBenchmarks
    const requiresBenchmarkSelection =
      benchmarkMode === 'specific' && selectedBenchmarks.length === 0;


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
# Conflicts:
#	.github/workflows/ci.yml
#	README.md
@ambv ambv merged commit 28a926d into main Mar 16, 2026
2 checks passed
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.

3 participants