-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
How-to use markdownItPlugins
in YAML?
#271
Comments
Your syntax seems correct. Here is an example with everything set: https://github.com/DavidAnson/markdownlint-cli2/blob/main/test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml Why do you think it isn't working? |
Oh, wait, it looks like you may be confusing the two types of configuration files. The fourth bullet point here explains that: https://github.com/DavidAnson/markdownlint-cli2#configuration |
@DavidAnson I am using only - repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.12.1
hooks:
- id: markdownlint-cli2
additional_dependencies:
- markdownlint-rule-relative-links and I am getting the error TypeError: plugin.apply is not a function
at MarkdownIt.use (/Users/foo/.cache/pre-commit/repos6uzlyzr/node_env-default/lib/node_modules/markdownlint-cli2/node_modules/markdown-it/dist/index.cjs.js:5432:10)
at lintInput (/Users/foo/.cache/pre-commit/repos6uzlyzr/node_env-default/lib/node_modules/markdownlint-cli2/node_modules/markdownlint/lib/markdownlint.js:908:8)
at markdownlint (/Users/foo/.cache/pre-commit/repos6uzlyzr/node_env-default/lib/node_modules/markdownlint-cli2/node_modules/markdownlint/lib/markdownlint.js:1003:10)
at node:internal/util:430:21
at new Promise (<anonymous>)
at markdownlint (node:internal/util:416:12)
at markdownlintPromise (/Users/foo/.cache/pre-commit/repos6uzlyzr/node_env-default/lib/node_modules/markdownlint-cli2/node_modules/markdownlint/lib/markdownlint.js:1016:10)
at lintFiles (/Users/foo/.cache/pre-commit/repos6uzlyzr/node_env-default/lib/node_modules/markdownlint-cli2/markdownlint-cli2.js:783:16)
at main (/Users/foo/.cache/pre-commit/repos6uzlyzr/node_env-default/lib/node_modules/markdownlint-cli2/markdownlint-cli2.js:1011:29)
at async /Users/foo/.cache/pre-commit/repos6uzlyzr/node_env-default/lib/node_modules/markdownlint-cli2/markdownlint-cli2.js:1053:26 Is the error related to markdownlint-cli2? Since you have mentioned node version Lines 404 to 405 in 82c791e
I have NodeJS already installed https://github.com/pre-commit/pre-commit/blob/73848383f2f4d0fc97b2a769afb6da35610672a8/pre_commit/languages/node.py#L31-L32 $ node --version
v20.11.0 Which is compatible with https://github.com/theoludwig/markdownlint-rule-relative-links/blob/146f904866e30a14faafdf77af1246e54b50792d/README.md?plain=1#L69 |
@vorburger, customRules:
- markdownlint-rule-relative-links You link to a @electriquo, you don't show the configuration you're using, so I can't tell what's going on, but the error above suggests you're making the same mistake. |
@DavidAnson You're awesome. After your explanation it works for me. Thank you. |
I use this great project (Thank You!) on https://github.com/enola-dev/enola,
via https://github.com/DavidAnson/vscode-markdownlint and (more importantly) through https://github.com/DavidAnson/markdownlint-cli2#pre-commit for https://pre-commit.com.
I currently use the https://github.com/DavidAnson/markdownlint-cli2#markdownlintyaml-or-markdownlintyml way to configure it, with a
.markdownlint.yaml
file, which seems to used both by Pre-Commit and VSC - that's great! (And seems better than e.g. configuring only VSC via https://github.com/DavidAnson/vscode-markdownlint#markdownlintcustomrules.)DavidAnson/markdownlint#121 made me discover https://github.com/theoludwig/markdownlint-rule-relative-links from @theoludwig and I would like to use it - but I can't seem to figure out how to configure plugins in YAML. I've tried adding this, for an "array of array" (with no options):
but it looks like that's just ignored? If I change a link to break it,
git add .
and then runpre-commit run --all-files
it doesn't flag it.https://github.com/DavidAnson/markdownlint/blob/main/README.md#optionsmarkdownitplugins mentions
require
but I suspect that's not required in YAML?@DavidAnson @theoludwig @igor-tsiglyar perhaps you have a suggestion? (I can raise a PR to clarify the doc, once I got it working.)
The text was updated successfully, but these errors were encountered: