Skip to content

fix: correct www autofix in no-bare-urls - #720

Open
tooth-is-silver wants to merge 8 commits into
eslint:mainfrom
tooth-is-silver:fix/no-bare-urls-www-autofix
Open

tooth-is-silver wants to merge 8 commits into
eslint:mainfrom
tooth-is-silver:fix/no-bare-urls-www-autofix

Conversation

@tooth-is-silver

@tooth-is-silver tooth-is-silver commented Aug 24, 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?

Fix the incorrect autofix for www autolinks.

What changes did you make? (Give an overview)

Updated no-bare-urls to convert www.example.com into [www.example.com](http://www.example.com).
Added a test for the autofix result.

Related Issues

Fixes #710

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

Nothing in particular.

Disclosure: I'm a participant of open source contribution program OSSCA

Summary by CodeRabbit

  • Bug Fixes
    • Improved automatic formatting for bare URLs containing Markdown-special characters.
    • Preserves link text and destinations by escaping characters such as parentheses, brackets, backslashes, backticks, and table pipes.
    • Correctly formats affected www. links as Markdown links instead of angle-bracket autolinks.

@eslintbot eslintbot added this to Triage Aug 24, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Aug 24, 2026
@tooth-is-silver tooth-is-silver changed the title fix: correct www autofix in no-bare-urls fix: correct www autofix in no-bare-urls Aug 24, 2026
@lumirlumir lumirlumir moved this from Needs Triage to Triaging in Triage Aug 25, 2026

@lumirlumir lumirlumir 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.

Disclosure: I'm a participant of open source contribution program OSSCA: confirmed.

Thanks for the PR. I’ve left a few comments about incorrect autofix cases.

Comment thread tests/rules/no-bare-urls.test.js
Comment thread tests/rules/no-bare-urls.test.js
@snitin315

Copy link
Copy Markdown
Contributor

Hi @tooth-is-silver, are you still working on this?

@tooth-is-silver

tooth-is-silver commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Hi @tooth-is-silver, are you still working on this?

Hi @snitin315 !
Yes, I’m still working on this.

@tooth-is-silver

Copy link
Copy Markdown
Contributor Author

@lumirlumir, could you please take a look at the updated commits?

Comment thread src/rules/no-bare-urls.js Outdated
Comment thread src/rules/no-bare-urls.js Outdated
Comment thread src/rules/no-bare-urls.js
Comment thread src/rules/no-bare-urls.js
@lumirlumir lumirlumir moved this from Triaging to Implementing in Triage Sep 17, 2026
@coderabbitai

coderabbitai Bot commented Sep 18, 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: 44ac3874-fb6f-402e-bc0d-982b0e1d009f

📥 Commits

Reviewing files that changed from the base of the PR and between 63542f5 and 1706710.

📒 Files selected for processing (2)
  • src/rules/no-bare-urls.js
  • tests/rules/no-bare-urls.test.js

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The no-bare-urls fixer now converts GFM www autolinks to escaped Markdown links. New tests cover special characters in link text and destinations.

Changes

WWW autolink autofix

Layer / File(s) Summary
Escaped Markdown link fix
src/rules/no-bare-urls.js
Adds patterns for link-text and destination escaping. The fixer emits [text](url) for GFM www autolinks and keeps the existing autolink output for other cases.
Special-character fix coverage
tests/rules/no-bare-urls.test.js
Adds autofix cases for parentheses, backslashes, brackets, emphasis markers, math dollar signs, table pipes, and HTML entities.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: lumirlumir

Merge Risk: ⚪ Minimal · up to 17067

The www autolink fix produces an explicit Markdown link rather than the crashing autofix form, with regression coverage for the intended behavior. No actionable merge risk remains.

🚥 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 identifies the main change: correcting the www autofix behavior in no-bare-urls.
Linked Issues check ✅ Passed Issue #710 requires no-bare-urls autofix to complete for GFM www autolinks without throwing and to produce output that the rule does not report. The PR changes the www case to `[escapedText](esc…
Out of Scope Changes check ✅ Passed The changed files are src/rules/no-bare-urls.js and its rule test file. The implementation and tests directly support issue #710. No unrelated change is shown in the supplied PR summary.
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 2…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Implementing

Development

Successfully merging this pull request may close these issues.

Bug: no-bare-urls autofix crashes for www autolinks

4 participants