-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Docs page(s)
Getting Started section
What documentation issue do you want to solve?
When updating from eslint-plugin-markdown (v5) to @eslint/markdown (v7), which now uses the language feature in its recommended config, rules from other plugins (including ESLint's core recommended config) started throwing errors about various sourceCode functions not being available when attempting to lint a markdown file.
That led me to add a whole number of shareable configs to a big "extends" block with ignores: ['**/*.md'], which doesn't feel like the best approach, but the documentation doesn't really provide any guidance around using the new version of the plugin with other plugins. Before the switch to using language, it worked fine beside other js-oriented configs. Now, it doesn't really, but the docs don't provide any tips or guidance around that.
Example error:
Oops! Something went wrong! :(
ESLint: 9.34.0
TypeError: Error while loading rule 'no-irregular-whitespace': sourceCode.getAllComments is not a function
Occurred while linting C:\Users\michael\src\eslint-plugin-package-json\.github\CODE_OF_CONDUCT.md
at Object.create (C:\Users\michael\src\eslint-plugin-package-json\node_modules\.pnpm\[email protected][email protected]\node_modules\eslint\lib\rules\no-irregular-whitespace.js:92:35)
at createRuleListeners (C:\Users\michael\src\eslint-plugin-package-json\node_modules\.pnpm\[email protected][email protected]\node_modules\eslint\lib\linter\linter.js:1019:15)
at C:\Users\michael\src\eslint-plugin-package-json\node_modules\.pnpm\[email protected][email protected]\node_modules\eslint\lib\linter\linter.js:1151:7
Example config to get around it
{
extends: [
eslintPlugin.configs.recommended,
jsdoc.configs["flat/contents-typescript-error"],
jsdoc.configs["flat/logical-typescript-error"],
jsdoc.configs["flat/stylistic-typescript-error"],
jsonc.configs["flat/recommended-with-json"],
n.configs["flat/recommended"],
perfectionist.configs["recommended-natural"],
],
ignores: ["**/*.md"],
}What do you think is the correct solution?
I'm not sure this new feature might help with this eslint/eslint#19462? But, until that lands, it seems like the docs should make onboarding to this plugin a bit easier?
Participation
- I am willing to submit a pull request for this change.
Additional comments
Also, it might be worth mentioning, that it took me forever to realize there was a new package name, in part because the original package name is not deprecated and doesn't point users towards the new name: https://www.npmjs.com/package/eslint-plugin-markdown It might be worth considering marking that package as deprecated with a note about the name change?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status