markdownlint-cli 0.44.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/markdownlint.js +13 -6
- package/package.json +14 -12
package/README.md
CHANGED
package/markdownlint.js
CHANGED
|
@@ -6,7 +6,7 @@ import Module from 'node:module';
|
|
|
6
6
|
import os from 'node:os';
|
|
7
7
|
import process from 'node:process';
|
|
8
8
|
import {program} from 'commander';
|
|
9
|
-
import {
|
|
9
|
+
import {globSync} from 'tinyglobby';
|
|
10
10
|
import {applyFixes} from 'markdownlint';
|
|
11
11
|
import {lint, readConfig} from 'markdownlint/sync';
|
|
12
12
|
import rc from 'run-con';
|
|
@@ -16,9 +16,13 @@ import jsonpointer from 'jsonpointer';
|
|
|
16
16
|
const require = Module.createRequire(import.meta.url);
|
|
17
17
|
const options = program.opts();
|
|
18
18
|
// The following two values are copied from package.json (and validated by tests)
|
|
19
|
-
const version = '0.
|
|
19
|
+
const version = '0.46.0';
|
|
20
20
|
const description = 'MarkdownLint Command Line Interface';
|
|
21
21
|
|
|
22
|
+
function markdownItFactory() {
|
|
23
|
+
return require('markdown-it')({html: true});
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
function posixPath(p) {
|
|
23
27
|
return p.split(path.sep).join(path.posix.sep);
|
|
24
28
|
}
|
|
@@ -61,7 +65,7 @@ function readConfiguration(userConfigFile) {
|
|
|
61
65
|
let config = rc('markdownlint', {});
|
|
62
66
|
for (const projectConfigFile of projectConfigFiles) {
|
|
63
67
|
try {
|
|
64
|
-
fs.accessSync(projectConfigFile
|
|
68
|
+
fs.accessSync(projectConfigFile);
|
|
65
69
|
const projectConfig = readConfig(projectConfigFile, configParsers);
|
|
66
70
|
config = {...config, ...projectConfig};
|
|
67
71
|
break;
|
|
@@ -89,7 +93,9 @@ function readConfiguration(userConfigFile) {
|
|
|
89
93
|
function prepareFileList(files, fileExtensions, previousResults) {
|
|
90
94
|
const globOptions = {
|
|
91
95
|
dot: Boolean(options.dot),
|
|
92
|
-
|
|
96
|
+
onlyFiles: true,
|
|
97
|
+
expandDirectories: false,
|
|
98
|
+
caseSensitiveMatch: !(os.platform() === 'win32' || os.platform() === 'darwin')
|
|
93
99
|
};
|
|
94
100
|
let extensionGlobPart = '*.';
|
|
95
101
|
if (!fileExtensions) {
|
|
@@ -111,7 +117,7 @@ function prepareFileList(files, fileExtensions, previousResults) {
|
|
|
111
117
|
return previousResults.filter(fileInfo => matcher.match(fileInfo.absolute)).map(fileInfo => fileInfo.original);
|
|
112
118
|
}
|
|
113
119
|
|
|
114
|
-
return
|
|
120
|
+
return globSync(posixPath(path.join(file, '**', extensionGlobPart)), globOptions);
|
|
115
121
|
}
|
|
116
122
|
} catch {
|
|
117
123
|
// Not a directory, not a file, may be a glob
|
|
@@ -120,7 +126,7 @@ function prepareFileList(files, fileExtensions, previousResults) {
|
|
|
120
126
|
return previousResults.filter(fileInfo => matcher.match(fileInfo.absolute)).map(fileInfo => fileInfo.original);
|
|
121
127
|
}
|
|
122
128
|
|
|
123
|
-
return
|
|
129
|
+
return globSync(file, globOptions);
|
|
124
130
|
}
|
|
125
131
|
|
|
126
132
|
// File
|
|
@@ -291,6 +297,7 @@ function lintAndPrint(stdin, files) {
|
|
|
291
297
|
}
|
|
292
298
|
|
|
293
299
|
const lintOptions = {
|
|
300
|
+
markdownItFactory,
|
|
294
301
|
config,
|
|
295
302
|
configParsers,
|
|
296
303
|
customRules,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdownlint-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "MarkdownLint Command Line Interface",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "markdownlint.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"markdownlint": "markdownlint.js"
|
|
9
9
|
},
|
|
10
10
|
"engines": {
|
|
11
|
-
"node": ">=
|
|
11
|
+
"node": ">=20"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"invalid": "node ./markdownlint.js --config test/test-config.json -- test/incorrect.md",
|
|
@@ -38,22 +38,24 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/igorshubovych/markdownlint-cli#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"commander": "~
|
|
42
|
-
"
|
|
43
|
-
"ignore": "~7.0.
|
|
44
|
-
"js-yaml": "~4.1.
|
|
41
|
+
"commander": "~14.0.2",
|
|
42
|
+
"deep-extend": "~0.6.0",
|
|
43
|
+
"ignore": "~7.0.5",
|
|
44
|
+
"js-yaml": "~4.1.1",
|
|
45
45
|
"jsonc-parser": "~3.3.1",
|
|
46
46
|
"jsonpointer": "~5.0.1",
|
|
47
|
-
"markdownlint": "~0.
|
|
48
|
-
"
|
|
47
|
+
"markdownlint": "~0.39.0",
|
|
48
|
+
"markdown-it": "~14.1.0",
|
|
49
|
+
"minimatch": "~10.1.1",
|
|
49
50
|
"run-con": "~1.3.2",
|
|
50
|
-
"smol-toml": "~1.
|
|
51
|
+
"smol-toml": "~1.5.2",
|
|
52
|
+
"tinyglobby": "~0.2.15"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
|
-
"ava": "^6.
|
|
55
|
+
"ava": "^6.4.1",
|
|
54
56
|
"markdownlint-cli-local-test-rule": "./test/custom-rules/markdownlint-cli-local-test-rule",
|
|
55
|
-
"nano-spawn": "^
|
|
56
|
-
"xo": "^
|
|
57
|
+
"nano-spawn": "^2.0.0",
|
|
58
|
+
"xo": "^1.2.3"
|
|
57
59
|
},
|
|
58
60
|
"xo": {
|
|
59
61
|
"prettier": true,
|