-
Notifications
You must be signed in to change notification settings - Fork 79
docs: add migration docs #559
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
base: main
Are you sure you want to change the base?
Conversation
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`.
There was a problem hiding this 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 -->
markdown/docs/rules/no-bare-urls.md
Lines 14 to 18 in 868153b
## 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 |
There was a problem hiding this 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.
docs/migration.md
Outdated
|
||
<!-- 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> `@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.
markdown/src/rules/no-multiple-h1.js
Lines 61 to 66 in 868153b
defaultOptions: [ | |
{ | |
frontmatterTitle: | |
"^(?!\\s*['\"]title[:=]['\"])\\s*\\{?\\s*['\"]?title['\"]?\\s*[:=]", | |
}, | |
], |
Line 20 in 868153b
Install the plugin alongside ESLint v9.15.0 or greater. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
```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 | ||
]); | ||
``` |
There was a problem hiding this comment.
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:
- Bug: Cannon use processor and recommended configs together #353
- Bug: Add combined mode to run Markdown rules and code-block linting concurrently for .md files #560
It might be helpful to update it and add a note that processor
and recommended
configs cannot be used together for now.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
Thanks for the feedback. I believe I've addressed everything. Let me know if there are any other updates you'd recommend. |
docs/migration.md
Outdated
}, | ||
extends: ["js/recommended"], | ||
}, | ||
markdown.configs.recommended, |
There was a problem hiding this comment.
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:
markdown.configs.recommended, | |
{ | |
files: ["**/*.md"], | |
plugins: { | |
markdown | |
}, | |
extends: ["markdown/recommended"] | |
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
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