Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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: 9a4809d

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! 🙂

import globals from 'globals'
import eslintPluginEslintPlugin from 'eslint-plugin-eslint-plugin/configs/all'
import eslintPluginJsonc from 'eslint-plugin-jsonc'
import eslintPluginNodeDependencies from 'eslint-plugin-node-dependencies'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import eslintMarkdown from '@eslint/markdown'
import markdownPreferences from 'eslint-plugin-markdown-preferences'
Copy link
Member

Choose a reason for hiding this comment

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

Please rename this variable to eslintPluginMarkdownPreferences for consistency, even if it's long.

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?

Comment on lines -142 to +161
/** A list of expression nodes to verify */
const expressions =
expression.type === 'TemplateLiteral'
? expression.expressions
: expression.type === 'ConditionalExpression'
? [expression.test, expression.consequent, expression.alternate]
: expression.type === 'Identifier'
? [expression]
: []
/** @type {Expression[]} A list of expression nodes to verify */
const expressions = []
switch (expression.type) {
case 'TemplateLiteral': {
expressions.push(...expression.expressions)
break
}
case 'ConditionalExpression': {
expressions.push(
expression.test,
expression.consequent,
expression.alternate
)
break
}
case 'Identifier': {
expressions.push(expression)
break
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This change is unrelated, right? It looks like a good change, so no need to revert it or anything, I just stumbled a bit over it.

Comment on lines 148 to +151
- [vue/singleline-html-element-content-newline](./singleline-html-element-content-newline.md)
- [no-multiple-empty-lines](https://eslint.org/docs/rules/no-multiple-empty-lines)
- [no-multiple-empty-lines]

[no-multiple-empty-lines]: https://eslint.org/docs/rules/no-multiple-empty-lines
Copy link
Member

Choose a reason for hiding this comment

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

Why extract one of them but not both? I think extracting only really makes sense when the link is reused multiple times, so here, I'd keep it inlined.

Comment on lines -115 to +117
- [vue-async-computed](https://github.com/foxbenjaminfox/vue-async-computed)
- [vue-async-computed]

[vue-async-computed]: https://github.com/foxbenjaminfox/vue-async-computed
Copy link
Member

Choose a reason for hiding this comment

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

Again, why extract the link target here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants