markdownlint-cli2 0.15.0 → 0.17.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/CHANGELOG.md +11 -0
- package/README.md +3 -3
- package/{append-to-array.js → append-to-array.mjs} +1 -4
- package/export-markdownlint-helpers.mjs +3 -0
- package/export-markdownlint-promise.mjs +3 -0
- package/export-markdownlint.mjs +3 -0
- package/markdownlint-cli2-bin.mjs +16 -0
- package/{markdownlint-cli2.js → markdownlint-cli2.mjs} +114 -163
- package/{merge-options.js → merge-options.mjs} +1 -3
- package/package.json +37 -35
- package/parsers/{jsonc-parse.js → jsonc-parse.mjs} +2 -4
- package/parsers/parsers.mjs +14 -0
- package/parsers/{yaml-parse.js → yaml-parse.mjs} +2 -4
- package/resolve-module.mjs +16 -0
- package/schema/markdownlint-cli2-config-schema.json +17 -17
- package/schema/markdownlint-config-schema.json +106 -106
- package/export-markdownlint-helpers.js +0 -5
- package/export-markdownlint.js +0 -5
- package/parsers/parsers.js +0 -16
- package/resolve-and-require.js +0 -19
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdownlint-cli2",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the `markdownlint` library",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "David Anson",
|
|
7
7
|
"url": "https://dlaa.me/"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"type": "
|
|
11
|
-
"main": "./markdownlint-cli2.js",
|
|
10
|
+
"type": "module",
|
|
12
11
|
"exports": {
|
|
13
|
-
".": "./markdownlint-cli2.
|
|
14
|
-
"./markdownlint": "./export-markdownlint.
|
|
15
|
-
"./markdownlint/helpers": "./export-markdownlint-helpers.
|
|
16
|
-
"./
|
|
17
|
-
"./parsers
|
|
18
|
-
"./parsers/
|
|
12
|
+
".": "./markdownlint-cli2.mjs",
|
|
13
|
+
"./markdownlint": "./export-markdownlint.mjs",
|
|
14
|
+
"./markdownlint/helpers": "./export-markdownlint-helpers.mjs",
|
|
15
|
+
"./markdownlint/promise": "./export-markdownlint-promise.mjs",
|
|
16
|
+
"./parsers": "./parsers/parsers.mjs",
|
|
17
|
+
"./parsers/jsonc": "./parsers/jsonc-parse.mjs",
|
|
18
|
+
"./parsers/yaml": "./parsers/yaml-parse.mjs"
|
|
19
19
|
},
|
|
20
20
|
"bin": {
|
|
21
|
-
"markdownlint-cli2": "markdownlint-cli2.
|
|
21
|
+
"markdownlint-cli2": "markdownlint-cli2-bin.mjs"
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/DavidAnson/markdownlint-cli2",
|
|
24
24
|
"repository": {
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"lint-dockerfile": "docker run --rm -i hadolint/hadolint:latest-alpine < docker/Dockerfile",
|
|
36
36
|
"lint-watch": "git ls-files | entr npm run lint",
|
|
37
37
|
"playwright-install-bare": "npm run playwright-install-npm && playwright install",
|
|
38
|
-
"playwright-install-npm": "npm install --no-save playwright@1.
|
|
38
|
+
"playwright-install-npm": "npm install --no-save playwright@1.49.1",
|
|
39
39
|
"playwright-test": "playwright test --config ./webworker/playwright.config.mjs",
|
|
40
|
-
"playwright-test-docker": "docker run --rm --volume $PWD:/home/workdir --workdir /home/workdir --ipc=host mcr.microsoft.com/playwright:v1.
|
|
40
|
+
"playwright-test-docker": "docker run --rm --volume $PWD:/home/workdir --workdir /home/workdir --ipc=host mcr.microsoft.com/playwright:v1.49.1 npm run playwright-test",
|
|
41
41
|
"schema": "cpy ./node_modules/markdownlint/schema/markdownlint-config-schema.json ./schema --flat",
|
|
42
|
-
"test": "ava --timeout=1m test/append-to-array-test.
|
|
42
|
+
"test": "ava --timeout=1m test/append-to-array-test.mjs test/fs-mock-test.mjs test/fs-virtual-test.mjs test/markdownlint-cli2-test.mjs test/markdownlint-cli2-test-exec.mjs test/markdownlint-cli2-test-exports.mjs test/markdownlint-cli2-test-fs.mjs test/markdownlint-cli2-test-main.mjs test/merge-options-test.mjs test/resolve-module-test.mjs",
|
|
43
43
|
"test-cover": "c8 --100 npm test",
|
|
44
44
|
"test-docker-hub-image": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker image rm davidanson/markdownlint-cli2:v$VERSION davidanson/markdownlint-cli2:latest || true && docker run --rm -v $PWD:/workdir davidanson/markdownlint-cli2:v$VERSION \"*.md\" && docker run --rm -v $PWD:/workdir davidanson/markdownlint-cli2:latest \"*.md\"",
|
|
45
45
|
"test-docker-hub-image-rules": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker image rm davidanson/markdownlint-cli2-rules:v$VERSION davidanson/markdownlint-cli2-rules:latest || true && docker run --rm -v $PWD:/workdir davidanson/markdownlint-cli2-rules:v$VERSION \"*.md\" && docker run --rm -v $PWD:/workdir davidanson/markdownlint-cli2-rules:latest \"*.md\"",
|
|
@@ -47,26 +47,28 @@
|
|
|
47
47
|
"test-docker-image-rules": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker run --rm -v $PWD:/workdir davidanson/markdownlint-cli2-rules:v$VERSION \"*.md\"",
|
|
48
48
|
"test-invoke-as-cli": "markdownlint-cli2 CHANGELOG.md",
|
|
49
49
|
"test-watch": "git ls-files | entr npm run test",
|
|
50
|
-
"update-snapshots": "ava --timeout=1m --update-snapshots test/markdownlint-cli2-test-exec.
|
|
50
|
+
"update-snapshots": "ava --timeout=1m --update-snapshots test/markdownlint-cli2-test-exec.mjs test/markdownlint-cli2-test-fs.mjs test/markdownlint-cli2-test-main.mjs",
|
|
51
51
|
"webworker": "cd webworker && webpack --mode none",
|
|
52
|
-
"webworker-install": "npm install --no-package-lock --no-save path-browserify setimmediate stream-browserify util webpack-cli && cpy ./node_modules/setimmediate/setImmediate.js ./webworker --flat"
|
|
52
|
+
"webworker-install": "npm install --no-package-lock --no-save path-browserify setimmediate stream-browserify util webpack-cli && cpy ./node_modules/setimmediate/setImmediate.js ./webworker --flat --rename=setImmediate.cjs"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=18"
|
|
56
56
|
},
|
|
57
57
|
"files": [
|
|
58
|
-
"append-to-array.
|
|
58
|
+
"append-to-array.mjs",
|
|
59
59
|
"CHANGELOG.md",
|
|
60
|
-
"export-markdownlint.
|
|
61
|
-
"export-markdownlint-helpers.
|
|
60
|
+
"export-markdownlint.mjs",
|
|
61
|
+
"export-markdownlint-helpers.mjs",
|
|
62
|
+
"export-markdownlint-promise.mjs",
|
|
62
63
|
"LICENSE",
|
|
63
|
-
"markdownlint-cli2.
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"parsers/
|
|
67
|
-
"parsers/
|
|
64
|
+
"markdownlint-cli2.mjs",
|
|
65
|
+
"markdownlint-cli2-bin.mjs",
|
|
66
|
+
"merge-options.mjs",
|
|
67
|
+
"parsers/parsers.mjs",
|
|
68
|
+
"parsers/jsonc-parse.mjs",
|
|
69
|
+
"parsers/yaml-parse.mjs",
|
|
68
70
|
"README.md",
|
|
69
|
-
"resolve-
|
|
71
|
+
"resolve-module.mjs",
|
|
70
72
|
"schema/markdownlint-cli2-config-schema.json",
|
|
71
73
|
"schema/markdownlint-config-schema.json",
|
|
72
74
|
"schema/ValidatingConfiguration.md"
|
|
@@ -75,36 +77,36 @@
|
|
|
75
77
|
"globby": "14.0.2",
|
|
76
78
|
"js-yaml": "4.1.0",
|
|
77
79
|
"jsonc-parser": "3.3.1",
|
|
78
|
-
"markdownlint": "0.
|
|
80
|
+
"markdownlint": "0.37.2",
|
|
79
81
|
"markdownlint-cli2-formatter-default": "0.0.5",
|
|
80
82
|
"micromatch": "4.0.8"
|
|
81
83
|
},
|
|
82
84
|
"devDependencies": {
|
|
83
|
-
"@eslint/js": "9.
|
|
85
|
+
"@eslint/js": "9.17.0",
|
|
84
86
|
"@iktakahiro/markdown-it-katex": "4.0.1",
|
|
85
|
-
"@playwright/test": "1.
|
|
86
|
-
"@stylistic/eslint-plugin": "2.
|
|
87
|
+
"@playwright/test": "1.49.1",
|
|
88
|
+
"@stylistic/eslint-plugin": "2.12.1",
|
|
87
89
|
"ajv": "8.17.1",
|
|
88
90
|
"ava": "6.2.0",
|
|
89
|
-
"c8": "10.1.
|
|
91
|
+
"c8": "10.1.3",
|
|
90
92
|
"cpy": "11.1.0",
|
|
91
93
|
"cpy-cli": "5.0.0",
|
|
92
94
|
"del": "8.0.0",
|
|
93
|
-
"eslint": "9.
|
|
94
|
-
"eslint-plugin-jsdoc": "50.
|
|
95
|
-
"eslint-plugin-n": "17.
|
|
96
|
-
"eslint-plugin-unicorn": "56.0.
|
|
97
|
-
"nano-spawn": "0.2.0",
|
|
95
|
+
"eslint": "9.17.0",
|
|
96
|
+
"eslint-plugin-jsdoc": "50.6.1",
|
|
97
|
+
"eslint-plugin-n": "17.15.1",
|
|
98
|
+
"eslint-plugin-unicorn": "56.0.1",
|
|
98
99
|
"markdown-it-emoji": "3.0.0",
|
|
99
100
|
"markdown-it-for-inline": "2.0.1",
|
|
100
101
|
"markdownlint-cli2-formatter-codequality": "0.0.5",
|
|
101
102
|
"markdownlint-cli2-formatter-json": "0.0.8",
|
|
102
103
|
"markdownlint-cli2-formatter-junit": "0.0.12",
|
|
103
104
|
"markdownlint-cli2-formatter-pretty": "0.0.7",
|
|
104
|
-
"markdownlint-cli2-formatter-sarif": "0.0.
|
|
105
|
+
"markdownlint-cli2-formatter-sarif": "0.0.3",
|
|
105
106
|
"markdownlint-cli2-formatter-summarize": "0.0.7",
|
|
106
107
|
"markdownlint-cli2-formatter-template": "0.0.2",
|
|
107
108
|
"markdownlint-rule-extended-ascii": "0.1.0",
|
|
109
|
+
"nano-spawn": "0.2.0",
|
|
108
110
|
"npm-run-all": "4.1.5"
|
|
109
111
|
},
|
|
110
112
|
"keywords": [
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const { parse, printParseErrorCode } = require("jsonc-parser");
|
|
3
|
+
import { parse, printParseErrorCode } from "jsonc-parser";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Parses a JSONC string, returning the corresponding object.
|
|
@@ -21,4 +19,4 @@ const jsoncParse = (text) => {
|
|
|
21
19
|
return result;
|
|
22
20
|
};
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
export default jsoncParse;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const yaml = require("js-yaml");
|
|
3
|
+
import yaml from "js-yaml";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Parses a YAML string, returning the corresponding object.
|
|
@@ -11,4 +9,4 @@ const yaml = require("js-yaml");
|
|
|
11
9
|
*/
|
|
12
10
|
const yamlParse = (text) => yaml.load(text);
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
export default yamlParse;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Wrapper for calling Node's require.resolve with additional paths.
|
|
5
|
+
* @param {object} require Node's require implementation (or equivalent).
|
|
6
|
+
* @param {string} request Module path to require.
|
|
7
|
+
* @param {string[]} paths Paths to resolve module location from.
|
|
8
|
+
* @returns {string} Resolved file name.
|
|
9
|
+
*/
|
|
10
|
+
const resolveModule = (require, request, paths) => {
|
|
11
|
+
const resolvePaths = require.resolve.paths ? require.resolve.paths("") : [];
|
|
12
|
+
const allPaths = [ ...paths, ...resolvePaths ];
|
|
13
|
+
return require.resolve(request, { "paths": allPaths });
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default resolveModule;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.17.0/schema/markdownlint-cli2-config-schema.json",
|
|
4
4
|
"title": "markdownlint-cli2 configuration schema",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"$schema": {
|
|
8
8
|
"description": "JSON Schema URI (expected by some editors)",
|
|
9
9
|
"type": "string",
|
|
10
|
-
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.
|
|
10
|
+
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.17.0/schema/markdownlint-cli2-config-schema.json"
|
|
11
11
|
},
|
|
12
12
|
"config": {
|
|
13
|
-
"description": "markdownlint configuration schema : https://github.com/DavidAnson/markdownlint/blob/v0.
|
|
14
|
-
"$ref": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.
|
|
13
|
+
"description": "markdownlint configuration schema : https://github.com/DavidAnson/markdownlint/blob/v0.37.2/schema/.markdownlint.jsonc",
|
|
14
|
+
"$ref": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.37.2/schema/markdownlint-config-schema.json",
|
|
15
15
|
"default": {}
|
|
16
16
|
},
|
|
17
17
|
"customRules": {
|
|
18
|
-
"description": "Module names or paths of custom rules to load and use when linting : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
18
|
+
"description": "Module names or paths of custom rules to load and use when linting : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
19
19
|
"type": "array",
|
|
20
20
|
"default": [],
|
|
21
21
|
"items": {
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"fix": {
|
|
28
|
-
"description": "Whether to enable fixing of linting errors reported by rules that emit fix information : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
28
|
+
"description": "Whether to enable fixing of linting errors reported by rules that emit fix information : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
29
29
|
"type": "boolean",
|
|
30
30
|
"default": false
|
|
31
31
|
},
|
|
32
32
|
"frontMatter": {
|
|
33
|
-
"description": "Regular expression used to match and ignore any front matter at the beginning of a document : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
33
|
+
"description": "Regular expression used to match and ignore any front matter at the beginning of a document : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
34
34
|
"type": "string",
|
|
35
35
|
"minLength": 1,
|
|
36
36
|
"default": ""
|
|
37
37
|
},
|
|
38
38
|
"gitignore": {
|
|
39
|
-
"description": "Whether to ignore files referenced by .gitignore (or glob expression) (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
39
|
+
"description": "Whether to ignore files referenced by .gitignore (or glob expression) (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
40
40
|
"type": [
|
|
41
41
|
"boolean",
|
|
42
42
|
"string"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"default": false
|
|
45
45
|
},
|
|
46
46
|
"globs": {
|
|
47
|
-
"description": "Glob expressions to include when linting (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
47
|
+
"description": "Glob expressions to include when linting (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
48
48
|
"type": "array",
|
|
49
49
|
"default": [],
|
|
50
50
|
"items": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"ignores": {
|
|
57
|
-
"description": "Glob expressions to ignore when linting : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
57
|
+
"description": "Glob expressions to ignore when linting : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
58
58
|
"type": "array",
|
|
59
59
|
"default": [],
|
|
60
60
|
"items": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"markdownItPlugins": {
|
|
67
|
-
"description": "markdown-it plugins to load and use when linting : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
67
|
+
"description": "markdown-it plugins to load and use when linting : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
68
68
|
"type": "array",
|
|
69
69
|
"default": [],
|
|
70
70
|
"items": {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"modulePaths": {
|
|
87
|
-
"description": "Additional paths to resolve module locations from : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
87
|
+
"description": "Additional paths to resolve module locations from : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
88
88
|
"type": "array",
|
|
89
89
|
"default": [],
|
|
90
90
|
"items": {
|
|
@@ -94,22 +94,22 @@
|
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
"noBanner": {
|
|
97
|
-
"description": "Whether to disable the display of the banner message and version numbers on stdout (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
97
|
+
"description": "Whether to disable the display of the banner message and version numbers on stdout (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
98
98
|
"type": "boolean",
|
|
99
99
|
"default": false
|
|
100
100
|
},
|
|
101
101
|
"noInlineConfig": {
|
|
102
|
-
"description": "Whether to disable support of HTML comments within Markdown content : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
102
|
+
"description": "Whether to disable support of HTML comments within Markdown content : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
103
103
|
"type": "boolean",
|
|
104
104
|
"default": false
|
|
105
105
|
},
|
|
106
106
|
"noProgress": {
|
|
107
|
-
"description": "Whether to disable the display of progress on stdout (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
107
|
+
"description": "Whether to disable the display of progress on stdout (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
108
108
|
"type": "boolean",
|
|
109
109
|
"default": false
|
|
110
110
|
},
|
|
111
111
|
"outputFormatters": {
|
|
112
|
-
"description": "Output formatters to load and use to customize markdownlint-cli2 output (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
112
|
+
"description": "Output formatters to load and use to customize markdownlint-cli2 output (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
113
113
|
"type": "array",
|
|
114
114
|
"default": [],
|
|
115
115
|
"items": {
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
131
|
"showFound": {
|
|
132
|
-
"description": "Whether to show the list of found files on stdout (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.
|
|
132
|
+
"description": "Whether to show the list of found files on stdout (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.17.0/README.md#markdownlint-cli2jsonc",
|
|
133
133
|
"type": "boolean",
|
|
134
134
|
"default": false
|
|
135
135
|
}
|