Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust suggestion fix ranges in processor #309

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Dec 22, 2024

This updates the processor to adjust suggestion fixes in the same way as autofixes.

Currently, with this example config:

// eslint.config.js
import markdown from "@eslint/markdown";

export default [
    {
        files: ["**/*.md"],
        plugins: {
            markdown
        },
        processor: "markdown/markdown"
    },
    {
        files: ["**/*.md/*.js"],
        rules: {
            "require-unicode-regexp": "error"
        }
    }
];

and this example code:

image

applying the "Add the 'u' flag" suggestion results in:

image

After this change, applying the suggestion will produce the correct result:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

1 participant