diff --git a/test/markdownlint-cli2-jsonc-example/.markdownlint-cli2.jsonc b/test/markdownlint-cli2-jsonc-example/.markdownlint-cli2.jsonc index 350631b8..87cd4992 100644 --- a/test/markdownlint-cli2-jsonc-example/.markdownlint-cli2.jsonc +++ b/test/markdownlint-cli2-jsonc-example/.markdownlint-cli2.jsonc @@ -34,6 +34,11 @@ [ "@iktakahiro/markdown-it-katex" ] ], + // Additional paths to resolve module locations from + "modulePaths": [ + "./modules" + ], + // Disable inline config comments "noInlineConfig": true, diff --git a/test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml b/test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml index adb4ee29..eca7edd6 100644 --- a/test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml +++ b/test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml @@ -30,6 +30,10 @@ markdownItPlugins: - - "@iktakahiro/markdown-it-katex" +# Additional paths to resolve module locations from +modulePaths: + - "./modules" + # Disable inline config comments noInlineConfig: true diff --git a/test/modulePaths-non-root/dir2/.markdownlint-cli2.cjs b/test/modulePaths-non-root/dir2/.markdownlint-cli2.cjs new file mode 100644 index 00000000..427994db --- /dev/null +++ b/test/modulePaths-non-root/dir2/.markdownlint-cli2.cjs @@ -0,0 +1,20 @@ +// @ts-check + +"use strict"; + +const path = require("node:path"); + +module.exports = { + "customRules": [ + "markdownlint-rule-sample-commonjs" + ], + "markdownItPlugins": [ + [ "custom-markdown-it-plugin" ] + ], + "modulePaths": [ + "../../customRules", + "../../invalid", + "../../no-config", + "../../markdownItPlugins/module" + ].map((dir) => path.resolve(__dirname, dir)) +}; diff --git a/test/modulePaths-non-root/dir2/link.md b/test/modulePaths-non-root/dir2/link.md new file mode 100644 index 00000000..88b7f3b6 --- /dev/null +++ b/test/modulePaths-non-root/dir2/link.md @@ -0,0 +1,3 @@ +# Heading + +Text [ link ](https://example.com) diff --git a/test/snapshots/markdownlint-cli2-test-exec.js.md b/test/snapshots/markdownlint-cli2-test-exec.js.md index f26076f7..bb1069d9 100644 --- a/test/snapshots/markdownlint-cli2-test-exec.js.md +++ b/test/snapshots/markdownlint-cli2-test-exec.js.md @@ -7250,7 +7250,7 @@ Generated by [AVA](https://avajs.dev). `, stdout: `markdownlint-cli2 vX.Y.Z (markdownlint vX.Y.Z)␊ Finding: **/*.md␊ - Linting: 5 file(s)␊ + Linting: 6 file(s)␊ Summary: 14 error(s)␊ `, } diff --git a/test/snapshots/markdownlint-cli2-test-exec.js.snap b/test/snapshots/markdownlint-cli2-test-exec.js.snap index 49d41766..1df6cce6 100644 Binary files a/test/snapshots/markdownlint-cli2-test-exec.js.snap and b/test/snapshots/markdownlint-cli2-test-exec.js.snap differ diff --git a/test/snapshots/markdownlint-cli2-test-main.js.md b/test/snapshots/markdownlint-cli2-test-main.js.md index f3436ae1..30f42d83 100644 --- a/test/snapshots/markdownlint-cli2-test-main.js.md +++ b/test/snapshots/markdownlint-cli2-test-main.js.md @@ -5325,7 +5325,7 @@ Generated by [AVA](https://avajs.dev). `, stdout: `markdownlint-cli2 vX.Y.Z (markdownlint vX.Y.Z)␊ Finding: **/*.md␊ - Linting: 5 file(s)␊ + Linting: 6 file(s)␊ Summary: 14 error(s)␊ `, } diff --git a/test/snapshots/markdownlint-cli2-test-main.js.snap b/test/snapshots/markdownlint-cli2-test-main.js.snap index dea4afe7..58139d12 100644 Binary files a/test/snapshots/markdownlint-cli2-test-main.js.snap and b/test/snapshots/markdownlint-cli2-test-main.js.snap differ