Skip to content

Commit

Permalink
Update .markdownlint-cli2.jsonc/yaml example files with modulePaths, …
Browse files Browse the repository at this point in the history
…add test case for absolute platform-specific modulePaths.
  • Loading branch information
DavidAnson committed Oct 5, 2023
1 parent e736a1a commit f079c44
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 2 deletions.
5 changes: 5 additions & 0 deletions test/markdownlint-cli2-jsonc-example/.markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
[ "@iktakahiro/markdown-it-katex" ]
],

// Additional paths to resolve module locations from
"modulePaths": [
"./modules"
],

// Disable inline config comments
"noInlineConfig": true,

Expand Down
4 changes: 4 additions & 0 deletions test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ markdownItPlugins:
-
- "@iktakahiro/markdown-it-katex"

# Additional paths to resolve module locations from
modulePaths:
- "./modules"

# Disable inline config comments
noInlineConfig: true

Expand Down
20 changes: 20 additions & 0 deletions test/modulePaths-non-root/dir2/.markdownlint-cli2.cjs
Original file line number Diff line number Diff line change
@@ -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))
};
3 changes: 3 additions & 0 deletions test/modulePaths-non-root/dir2/link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Heading

Text [ link ](https://example.com)
2 changes: 1 addition & 1 deletion test/snapshots/markdownlint-cli2-test-exec.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)␊
`,
}
Binary file modified test/snapshots/markdownlint-cli2-test-exec.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion test/snapshots/markdownlint-cli2-test-main.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)␊
`,
}
Binary file modified test/snapshots/markdownlint-cli2-test-main.js.snap
Binary file not shown.

0 comments on commit f079c44

Please sign in to comment.