Skip to content

Add ESLint with CI enforcement - #10

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

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

Conversation

@ambv

@ambvambv commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

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.

ambvand 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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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
FileDescription
frontend/src/types/components.tsRemoves unused type imports to satisfy linting.
frontend/src/types/api.tsChanges TrendQueryParams to a type alias for backward compatibility.
frontend/src/lib/api.tsRemoves unused imported API types.
frontend/src/hooks/use-toast.tsRefactors action type definitions to avoid unused constants.
frontend/src/components/ui/textarea.tsxSimplifies props type to a type alias.
frontend/src/components/ui/dialog.tsxExports DialogClose from the dialog UI module.
frontend/src/components/ui/collapsible.tsxRemoves unused React import.
frontend/src/components/diff/CommitTooltipContent.tsxRemoves unused UI imports.
frontend/src/app/version-comparison/page.tsxRemoves unused imports/variables; escapes apostrophes for JSX.
frontend/src/app/trends/page.tsxApplies prefer-const in key parsing logic.
frontend/src/app/page.tsxRemoves unused index parameter in .map.
frontend/src/app/diff/page.tsxRemoves unused imports/helpers; minor whitespace cleanup.
frontend/src/app/build-comparison/page.tsxLint-driven refactors (consts, escaping); adjusts memoization usage.
frontend/src/app/binaries/[id]/page.tsxPrefixes unused prop with _ to satisfy no-unused-vars rule.
frontend/src/app/admin/page.tsxRemoves unused constants/imports; simplifies catch blocks.
frontend/src/app/admin/components/TokensManager.tsxSimplifies catch blocks; escapes apostrophes in UI text.
frontend/src/app/admin/components/QueryConsole.tsxReworks dynamic imports; removes unused imports; formatting cleanup.
frontend/src/app/admin/components/MemrayFailuresManager.tsxRemoves unused API_BASE.
frontend/src/app/admin/components/EnvironmentsManager.tsxSimplifies catch blocks; formatting cleanup.
frontend/src/app/admin/components/BinariesManager.tsxRemoves unused imports; simplifies catch blocks.
frontend/src/app/admin/components/BenchmarkResultsManager.tsxRemoves unused icon imports; simplifies catch blocks; formatting cleanup.
frontend/src/app/admin/components/AdminUsersManager.tsxRemoves unused imports/types; formatting cleanup.
frontend/src/app/about/page.tsxSimplifies catch blocks; escapes apostrophes; removes unused index.
frontend/package.jsonAdds eslint and eslint-config-next devDependencies.
docker-README.mdDocuments linting and typecheck commands via Docker.
README.mdUpdates testing instructions and notes CI enforcement.
.github/workflows/ci.ymlReplaces 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.

Comment threadREADME.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts:
#	.github/workflows/ci.yml
#	README.md
@ambv
ambv merged commit 28a926d into mainMar 16, 2026
2 checks passed
Sign up for freeto 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

@ambv@Yhg1s