Skip to content

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

Description

@tooth-is-silver

Environment

ESLint version: v10.8.1
@eslint/markdown version: v8.0.3
Node version: v24.14.0
npm version: 11.9.0
Operating System: macOS 26.5 (Darwin 25.5.0)

Which language are you using?

gfm

What did you do?

Configuration
import markdown from "@eslint/markdown";

export default [
    {
        files: ["**/*.md"],
        plugins: { markdown },
        language: "markdown/gfm",
        rules: {
            "markdown/no-bare-urls": "error",
        },
    },
];

I ran ESLint with --fix:

npx eslint --fix test.md

test.md contains:

Visit www.example.com for details.

What did you expect to happen?

ESLint should complete the autofix without throwing an error.
The fixed output should no longer be reported by markdown/no-bare-urls.

What actually happened?

ESLint aborted during autofix:

Error: Custom getRange() method must be implemented in the subclass.
Occurred while linting test.md:1
Rule: "markdown/no-bare-urls"

The rule's first fix replaces www.example.com with <www.example.com>.
Linting <www.example.com> directly reproduces the same error.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/node-jwpkwim7?file=test.md

Participation

  • I am willing to submit a pull request for this issue.

AI acknowledgment

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

Additional comments

GFM already recognizes www.example.com as an extended autolink:

https://github.github.com/gfm/#autolinks-extension-

Possible valid fixes include <http://www.example.com> or [www.example.com](http://www.example.com). I think the exact output can be decided separately.

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

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

  • Status
    Ready to Implement

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions