Skip to content

chore(lint): enable e18e rules with oxlint - #134

Merged
fengmk2 merged 2 commits into
masterfrom
chore/e18e-eslint-plugin
Oct 16, 2026
Merged

fengmk2 merged 2 commits into
masterfrom
chore/e18e-eslint-plugin

Conversation

@fengmk2

@fengmk2 fengmk2 commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Add @e18e/eslint-plugin to detect avoidable allocations and older JavaScript patterns. Run 10 rules through oxlint after the existing Next.js checks in npm run lint. Move repeated regular expressions to module scope and use .some() for an existence check.

The plugin runs through oxlint because Next.js uses ESLint 8. A scoped dependency override resolves the plugin's unused optional eslint peer. Rules that require newer browser APIs, dependency replacements, or type information from ESLint remain disabled. Regular expressions stay beside their test assertions.

Summary by CodeRabbit

  • Chores
    • Added automated code-quality checks to the development workflow.
  • Refactor
    • Streamlined repeated pattern matching across the app. Existing behavior, including dependency links, download summaries, version tags, and path handling, remains unchanged. No end-user-facing features or behavior changes are included in this release.

Path substitution replaces only the first * and preserves wildcard version queries and literal filename characters.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:37
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cnpmweb Ready Ready Preview Oct 16, 2026 3:48pm UTC

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c9524c6-32cd-47f8-b8e9-e924bedc59a6
📥 Commits

Reviewing files that changed from the base of the PR and between fdb5000 and 8c24270.

📒 Files selected for processing: 8
  • .oxlintrc.json
  • package.json
  • src/components/CodeViewer.tsx
  • src/components/RecentDownloads.tsx
  • src/components/VersionTags.tsx
  • src/hooks/useHighlightHash.ts
  • src/hooks/useNamePlaceholder.ts
  • src/hooks/usePathState.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The pull request adds Oxlint configuration and dependencies, and runs Oxlint as part of the lint script. Several components and hooks now use module-level regular-expression constants. TotalDownloads uses some to check for responses with truthy downloads.

Changes: Lint setup and source updates

Layer / File(s) Summary
Add Oxlint configuration and scripts
.oxlintrc.json, package.json
Adds ten error-level rules and a test-file override. The lint script runs Oxlint after next lint.
Update component and hook checks
src/components/CodeViewer.tsx, src/components/RecentDownloads.tsx, src/components/VersionTags.tsx, src/hooks/useHighlightHash.ts, src/hooks/useNamePlaceholder.ts, src/hooks/usePathState.ts
Replaces inline regular expressions with module-level constants. TotalDownloads uses some instead of find; its empty-state condition remains based on whether any response has truthy downloads.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: elrrrrrrr

Merge Risk: ⚪ Minimal · up to 8c242

This change moves regular expressions to module scope and adds a lint step. It does not change runtime behavior. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: enabling e18e lint rules with Oxlint.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@socket-security

socket-security Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​oxlint@​1.88.0991009196100
Addednpm/​@​e18e/​eslint-plugin@​0.8.110010010092100

View full report

Comment thread src/hooks/usePathState.ts Fixed
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Deploying cnpmweb with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6a2a7d0
Status: ✅  Deploy successful!
Preview URL: https://bc9fa97a.cnpmweb.pages.dev
Branch Preview URL: https://chore-e18e-eslint-plugin.cnpmweb.pages.dev

View logs

Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:43

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@fengmk2
fengmk2 merged commit d811286 into master Oct 16, 2026
13 checks passed
@fengmk2
fengmk2 deleted the chore/e18e-eslint-plugin branch October 16, 2026 15:59

This branch was successfully deployed

1 active deployment
Preview — 6a2a7d02 Deployed Oct 16, 2026 by vercel[bot]
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