markdownlint-cli 0.38.0 → 0.39.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 +12 -4
- package/package.json +4 -4
package/README.md
CHANGED
package/markdownlint.js
CHANGED
|
@@ -21,10 +21,18 @@ function posixPath(p) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function jsoncParse(text) {
|
|
24
|
-
|
|
24
|
+
const {parse, printParseErrorCode} = require('jsonc-parser');
|
|
25
|
+
const errors = [];
|
|
26
|
+
const result = parse(text, errors, {allowTrailingComma: true});
|
|
27
|
+
if (errors.length > 0) {
|
|
28
|
+
const aggregate = errors.map(error => `${printParseErrorCode(error.error)} (offset ${error.offset}, length ${error.length})`).join(', ');
|
|
29
|
+
throw new Error(`Unable to parse JSON(C) content, ${aggregate}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return result;
|
|
25
33
|
}
|
|
26
34
|
|
|
27
|
-
function
|
|
35
|
+
function yamlParse(text) {
|
|
28
36
|
return require('js-yaml').load(text);
|
|
29
37
|
}
|
|
30
38
|
|
|
@@ -36,7 +44,7 @@ const exitCodes = {
|
|
|
36
44
|
};
|
|
37
45
|
|
|
38
46
|
const projectConfigFiles = ['.markdownlint.jsonc', '.markdownlint.json', '.markdownlint.yaml', '.markdownlint.yml'];
|
|
39
|
-
const configParsers = [jsoncParse,
|
|
47
|
+
const configParsers = [jsoncParse, yamlParse];
|
|
40
48
|
const fsOptions = {encoding: 'utf8'};
|
|
41
49
|
const processCwd = process.cwd();
|
|
42
50
|
|
|
@@ -199,7 +207,7 @@ program.parse(process.argv);
|
|
|
199
207
|
|
|
200
208
|
function tryResolvePath(filepath) {
|
|
201
209
|
try {
|
|
202
|
-
if (path.basename(filepath) === filepath && path.extname(filepath) === '') {
|
|
210
|
+
if ((path.basename(filepath) === filepath || filepath.startsWith('@')) && path.extname(filepath) === '') {
|
|
203
211
|
// Looks like a package name, resolve it relative to cwd
|
|
204
212
|
// Get list of directories, where requested module can be.
|
|
205
213
|
let paths = Module._nodeModulePaths(processCwd);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdownlint-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "MarkdownLint Command Line Interface",
|
|
5
5
|
"main": "markdownlint.js",
|
|
6
6
|
"bin": {
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"glob": "~10.3.10",
|
|
43
43
|
"ignore": "~5.3.0",
|
|
44
44
|
"js-yaml": "^4.1.0",
|
|
45
|
-
"jsonc-parser": "~3.2.
|
|
46
|
-
"markdownlint": "~0.
|
|
45
|
+
"jsonc-parser": "~3.2.1",
|
|
46
|
+
"markdownlint": "~0.33.0",
|
|
47
47
|
"minimatch": "~9.0.3",
|
|
48
48
|
"run-con": "~1.3.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"ava": "^6.0
|
|
51
|
+
"ava": "^6.1.0",
|
|
52
52
|
"execa": "^8.0.1",
|
|
53
53
|
"markdownlint-cli-local-test-rule": "./test/custom-rules/markdownlint-cli-local-test-rule",
|
|
54
54
|
"xo": "^0.56.0"
|