Skip to content

refactor: remove isWellFormed existence check in no-unsafe-values - #286

Merged
mdjermanovic merged 1 commit into
mainfrom
refactor/remove-iswellformed-guard
Sep 20, 2026
Merged

mdjermanovic merged 1 commit into
mainfrom
refactor/remove-iswellformed-guard

Conversation

@Pixel998

@Pixel998 Pixel998 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Prerequisites checklist

AI acknowledgment

  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

What is the purpose of this pull request?

Remove dead code from the no-unsafe-values rule.

What changes did you make? (Give an overview)

Dropped the existence check for String.prototype.isWellFormed. It was needed for Node 18, but the package now requires Node 20.19.0 or later, which always has the method.

Related Issues

Is there anything you'd like reviewers to focus on?

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of malformed strings in the unsafe-values validation rule.
    • Preserved existing reporting behavior for strings containing lone surrogate characters.

@eslintbot eslintbot added this to Triage Sep 20, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Sep 20, 2026
@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Review Change StackReview 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: 17b04508-a81a-4102-aa62-23659f6deca1

📥 Commits

Reviewing files that changed from the base of the PR and between 3c606ad and f1dd483.

📒 Files selected for processing (1)
  • src/rules/no-unsafe-values.js

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The no-unsafe-values rule now calls node.value.isWellFormed() directly. The existing lone-surrogate reporting logic remains unchanged.

Changes

Unsafe value validation

Layer / File(s) Summary
Direct well-formed string check
src/rules/no-unsafe-values.js
The String(node) handler calls node.value.isWellFormed() directly and returns early when the value is well-formed. The previous method-existence guard was removed.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor

Suggested reviewers: lumirlumir

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the isWellFormed existence check from the no-unsafe-values rule.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@mdjermanovic mdjermanovic moved this from Needs Triage to Triaging in Triage Sep 20, 2026
@mdjermanovic

Copy link
Copy Markdown
Member

I couldn't find the String.prototype.isWellFormed feature on the node.green site, but per https://nodejs.org/en/blog/announcements/v20-release-announce it is indeed supported since Node v20.0.0.

@mdjermanovic mdjermanovic moved this from Triaging to Implementing in Triage Sep 20, 2026

@mdjermanovic mdjermanovic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdjermanovic
mdjermanovic merged commit 53712f2 into main Sep 20, 2026
40 checks passed
@mdjermanovic
mdjermanovic deleted the refactor/remove-iswellformed-guard branch September 20, 2026 16:02
@github-project-automation github-project-automation Bot moved this from Implementing to Complete in Triage Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants