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

Merged
merged 1 commit into from
Dec 29, 2024
Merged

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

@fasttime
Copy link
Member

Thanks! I can reproduce this problem. Marking as accepted.

@fasttime fasttime added accepted repro:yes Issues with a reproducible example labels Dec 28, 2024
Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@fasttime fasttime merged commit f164e66 into main Dec 29, 2024
15 checks passed
@fasttime fasttime deleted the processor-suggestions branch December 29, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug repro:yes Issues with a reproducible example
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

2 participants