-
-
Notifications
You must be signed in to change notification settings - Fork 692
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
base: master
Are you sure you want to change the base?
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! 🙂
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' |
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.
Please rename this variable to eslintPluginMarkdownPreferences
for consistency, even if it's long.
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?
/** 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 | ||
} | ||
} |
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.
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.
- [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 |
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 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.
- [vue-async-computed](https://github.com/foxbenjaminfox/vue-async-computed) | ||
- [vue-async-computed] | ||
|
||
[vue-async-computed]: https://github.com/foxbenjaminfox/vue-async-computed |
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.
Again, why extract the link target here?
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.