eslint-mdx icon indicating copy to clipboard operation
eslint-mdx copied to clipboard

Please document how to make the linter fixable

Open Zemnmez opened this issue 2 years ago • 3 comments
trafficstars

Initial checklist

Problem

The current readme.md says this:

possible fixable depends on your remark plugins:

But it doesn't elaborate on what needs to be done to make the lint fixable. For example, currently, applying this plugin for me removed all my markdown line-wraps.

I've made the line length an error, but it doesn't appear to expose a fixer. The remark lint documentation describes some steps to achieve this, but they involve instrumenting remark-cli, something the eslint-mdx docs do not cover.

Thanks!

Solution

Markdown files should be automatically fixed.

Alternatives

Use remark-cli directly.

Zemnmez avatar Jul 14 '23 15:07 Zemnmez

Can you provide a reproduction that eslint --fix doesn't work but remark-cli works?

JounQin avatar Jul 14 '23 15:07 JounQin

I just tried using the config example that remark-lint uses and notices it fixes some things.

Maybe we could just amend the documentation to say "not all remark-lint rules have automatic fixers"?

Zemnmez avatar Jul 14 '23 15:07 Zemnmez

@Zemnmez That is how I would interpret the existing comment in the documentation, but if you believe it can be worded for more clarity, feel free to open a PR. remark-lint rules by themselves do not have fixers https://github.com/remarkjs/remark-lint/issues/82 But some stylistic ones can be fixed by indirectly, through the remark/mdx stringifier options.

ChristianMurphy avatar Jul 28 '23 04:07 ChristianMurphy