Skip to content

chore: add eslint-plugin-regexp#1123

Merged
danielroe merged 4 commits intonpmx-dev:mainfrom
btea:chore/add-eslint-plugin-regexp
Feb 7, 2026
Merged

chore: add eslint-plugin-regexp#1123
danielroe merged 4 commits intonpmx-dev:mainfrom
btea:chore/add-eslint-plugin-regexp

Conversation

@btea
Copy link
Contributor

@btea btea commented Feb 7, 2026

@vercel
Copy link

vercel bot commented Feb 7, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 7, 2026 4:09am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 7, 2026 4:09am
npmx-lunaria Ignored Ignored Feb 7, 2026 4:09am

Request Review

@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/utils/formatters.ts 0.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

📝 Walkthrough

Walkthrough

The PR adds the eslint-plugin-regexp package (dependencies and devDependencies), enables it in .oxlintrc.json and knip.ts, and introduces a large set of RegExp linting rules. It also applies multiple small regex refinements across the codebase: converting unnecessary capturing groups to non‑capturing ones, tightening or simplifying character-class patterns, adjusting frontmatter delimiters to allow trailing horizontal whitespace, and a minor change to an HTML style-attribute strip pattern.

Possibly related PRs

Suggested reviewers

  • danielroe
  • serhalp
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is minimal but directly relates to the changeset, which adds eslint-plugin-regexp and configures related rules.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
server/utils/docs/text.ts (2)

101-113: ⚠️ Potential issue | 🟡 Minor

Allow trailing spaces after the fenced info string.

According to the CommonMark specification, trailing spaces after the language identifier are valid and should be trimmed by the parser. The current regex pattern requires an immediate newline after the captured language token, so code fences with trailing spaces—which are valid Markdown—won't be detected.

🔧 Suggested fix
-    /```[ \t]*(\w*)(?:\r\n|\r|\n)([\s\S]*?)(?:\r\n|\r|\n)?```/g,
+    /```[ \t]*(\w*)[ \t]*(?:\r\n|\r|\n)([\s\S]*?)(?:\r\n|\r|\n)?```/g,

70-89: ⚠️ Potential issue | 🟠 Major

Multi-word link labels fail to match the regex pattern.

The label pattern [^\s}]* forbids spaces, so {@link https://example.com Example Site} won't match and will remain as escaped text in the output. The test "should handle external URLs with labels" in the test suite expects this case to work.

🔧 Suggested fix
-  result = result.replace(/\{`@link`\s+([^\s}]+)(?:\s+([^\s}]*))?\}/g, (_, target, label) => {
-    const displayText = label || target
+  result = result.replace(/\{`@link`\s+([^\s}]+)(?:\s+([^}]*))?\}/g, (_, target, label) => {
+    const displayText = (label && label.trim()) || target

@danielroe danielroe added this pull request to the merge queue Feb 7, 2026
Merged via the queue into npmx-dev:main with commit f13279e Feb 7, 2026
18 checks passed
@btea btea deleted the chore/add-eslint-plugin-regexp branch February 7, 2026 08:39
whitep4nth3r pushed a commit that referenced this pull request Feb 7, 2026
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