Skip to content

Conversation

ota-meshi
Copy link
Member

This PR introduces @eslint/markdown and eslint-plugin-markdown-preferences to the repository.

We prefer to have links in rule names in release notes and changelog, and this PR will allow the markdown-preferences/prefer-linked-words rule to automatically detect and fix that.

https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-linked-words.html

After merging this PR, I believe the changeset:version script should automatically include the link without having to include it in the changeset file.

Copy link

changeset-bot bot commented Aug 3, 2025

⚠️ No Changeset found

Latest commit: e062b27

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

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

Very nice improvement, thank you! 🙂

export default typegen([
{
ignores: [
'.nyc_output',
'coverage',
'node_modules',
'.changeset/**/*.md',
Copy link
Member

Choose a reason for hiding this comment

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

Why are those files ignored completely?

Copy link
Member Author

Choose a reason for hiding this comment

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

Those markdown files are often created on GitHub, and I think it would be annoying if the created Markdown files would result in errors due to CI.
Even if there are problems with those markdown files, they will eventually be merged into the CHANGELOG and the CHANGELOG will be checked by CI, so I don't think the problems will remain.

Copy link
Member

Choose a reason for hiding this comment

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

But the release notes on GitHub are created from exactly those Markdown files, right? I think having the links is most helpful there, so people can quickly jump into the relevant documentation pages when they see a new release.

Copy link
Member Author

@ota-meshi ota-meshi Aug 5, 2025

Choose a reason for hiding this comment

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

Links from rule names will be created automatically.
Take a look at the following PR.

ota-meshi/eslint-plugin-markdown-preferences#35

The changeset file only lists the rule name and not the link, but ESLint's autofix will automatically change the rule name to a link during the release workflow.
This will be used for changelogs and release notes.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, cool!

Copy link
Member

Choose a reason for hiding this comment

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

@ota-meshi Unfortunately, that seems to not work:

After merging #2918, the Release job failed with an ESLint error:

/home/runner/work/eslint-plugin-vue/eslint-plugin-vue/CHANGELOG.md
Error:   13:11  error  The word "vue/define-macros-order" should be a link  markdown-preferences/prefer-linked-words

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

Error: Error: The process '/usr/local/bin/npm' failed with exit code 1
Error: The process '/usr/local/bin/npm' failed with exit code 1

And thus, the commit (and following ones) never made it to the Version Packages PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, npm run lint -- --fix won't work. Instead, we need to use npm run lint:fix.
I'll submit a PR for this.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

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

Thanks!

@FloEdelmann FloEdelmann added the meta Code style improvements, build process improvements, refactorings label Aug 5, 2025
Copy link
Member

@waynzh waynzh left a comment

Choose a reason for hiding this comment

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

Thank you!

@FloEdelmann FloEdelmann merged commit 1d59e53 into master Aug 8, 2025
15 checks passed
@FloEdelmann FloEdelmann deleted the use-eslint-markdown branch August 8, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Code style improvements, build process improvements, refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants