Skip to content

Conversation

michaelfaith
Copy link

Prerequisites checklist

What changes did you make? (Give an overview)

This change adds a new migration.md file where details about major migrations can be documented. The first section is details about migrating from the previous implementation eslint-plugin-markdown.

fixes #517

This change adds a new migration.md file where details about major migrations can be documented.  The first section is details about migrating from the previous implementation `eslint-plugin-markdown`.
@eslintbot eslintbot added this to Triage Oct 12, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Oct 12, 2025
@michaelfaith michaelfaith marked this pull request as ready for review October 12, 2025 19:59
@aladdin-add aladdin-add moved this from Needs Triage to Implementing in Triage Oct 14, 2025
Copy link
Member

@lumirlumir lumirlumir left a comment

Choose a reason for hiding this comment

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

Hi @michaelfaith, could you take a look at the CI failures?

The failure related to the Markdown document will be resolved once we add the following line:

<!-- eslint-disable-line -- This should be fixed in https://github.com/eslint/markdown/issues/294 -->

## Rule Details
> [!IMPORTANT] <!-- eslint-disable-line -- This should be fixed in https://github.com/eslint/markdown/issues/294 -->
>
> This rule requires `language: "markdown/gfm"`.

The Bun CI failure should be resolved once #555 is merged.

(If this PR needs to be merged quickly, it can be resolved by adding @types/unist, @types/mdast, and semver to the dev dependencies.)

@michaelfaith
Copy link
Author

Hi @michaelfaith, could you take a look at the CI failures?

The failure related to the Markdown document will be resolved once we add the following line:

<!-- eslint-disable-line -- This should be fixed in https://github.com/eslint/markdown/issues/294 -->

## Rule Details
> [!IMPORTANT] <!-- eslint-disable-line -- This should be fixed in https://github.com/eslint/markdown/issues/294 -->
>
> This rule requires `language: "markdown/gfm"`.

The Bun CI failure should be resolved once #555 is merged.

(If this PR needs to be merged quickly, it can be resolved by adding @types/unist, @types/mdast, and semver to the dev dependencies.)

Thanks! I made those updates

Copy link
Member

@lumirlumir lumirlumir left a comment

Choose a reason for hiding this comment

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

Thanks for working on this issue! The migration guide looks good.

However, I noticed a few things missing, so I've left some comments throughout the documentation.


<!-- eslint-disable-next-line markdown/no-missing-label-refs -- This should be fixed in https://github.com/eslint/markdown/issues/294 -->
> [!NOTE]
> `@eslint/markdown` requires that you're on at least ESLint v9.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> `@eslint/markdown` requires that you're on at least ESLint v9.
> `@eslint/markdown` requires that you're on at least ESLint v9.15.0.

Since @eslint/markdown uses meta.defaultOptions internally, which was introduced in ESLint 9.15.0, I think it would be helpful to specify version 9.15.0.

defaultOptions: [
{
frontmatterTitle:
"^(?!\\s*['\"]title[:=]['\"])\\s*\\{?\\s*['\"]?title['\"]?\\s*[:=]",
},
],

Install the plugin alongside ESLint v9.15.0 or greater.

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good. Should that be declared in the peerDeps for the package then?

Copy link
Author

Choose a reason for hiding this comment

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

Updated

Comment on lines 40 to 51
```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";

export default defineConfig([
markdown.configs.recommended,
markdown.configs.processor,

// your other configs
]);
```
Copy link
Member

@lumirlumir lumirlumir Oct 15, 2025

Choose a reason for hiding this comment

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

Unfortunately, the current ESLint implementation does not support using processor and recommended configs together:

It might be helpful to update it and add a note that processor and recommended configs cannot be used together for now.

Copy link
Author

Choose a reason for hiding this comment

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

Updated and added a WARNING note about using them together. Let me know what you think.

Copy link
Member

@lumirlumir lumirlumir Oct 15, 2025

Choose a reason for hiding this comment

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

Could we also add a link in /README.md to docs/migration.md?

For example, adding a link in "## Migration from eslint-plugin-markdown" section, similar to the ## Usage or ## Editor Integrations sections, would be great.

## Usage

## Editor Integrations

Copy link
Author

Choose a reason for hiding this comment

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

Add the link to the README

@michaelfaith
Copy link
Author

Thanks for the feedback. I believe I've addressed everything. Let me know if there are any other updates you'd recommend.

},
extends: ["js/recommended"],
},
markdown.configs.recommended,
Copy link
Member

Choose a reason for hiding this comment

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

We're encouraging people to use extends now:

Suggested change
markdown.configs.recommended,
{
files: ["**/*.md"],
plugins: {
markdown
},
extends: ["markdown/recommended"]
}

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good. And that's the case even for configs that already declare files and plugins in the configs?

Copy link
Author

Choose a reason for hiding this comment

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

Updated

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.

Docs: When updating from eslint-plugin-markdown other plugins start throwing errors

4 participants