-
-
Notifications
You must be signed in to change notification settings - Fork 696
chore: introduce @eslint/markdown
and eslint-plugin-markdown-preferences
#2913
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
Conversation
|
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.
Very nice improvement, thank you! 🙂
export default typegen([ | ||
{ | ||
ignores: [ | ||
'.nyc_output', | ||
'coverage', | ||
'node_modules', | ||
'.changeset/**/*.md', |
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.
Why are those files ignored completely?
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.
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.
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.
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.
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.
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.
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.
Ah, cool!
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.
@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.
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.
Oh, npm run lint -- --fix
won't work. Instead, we need to use npm run lint:fix
.
I'll submit a PR for this.
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.
Thanks!
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.
Thank you!
This PR introduces
@eslint/markdown
andeslint-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.