markdownlint-cli2 0.10.0 → 0.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdownlint-cli2",
3
- "version": "0.10.0",
3
+ "version": "0.12.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",
@@ -15,9 +15,7 @@
15
15
  "./markdownlint/helpers": "./export-markdownlint-helpers.js"
16
16
  },
17
17
  "bin": {
18
- "markdownlint-cli2": "markdownlint-cli2.js",
19
- "markdownlint-cli2-config": "markdownlint-cli2-config.js",
20
- "markdownlint-cli2-fix": "markdownlint-cli2-fix.js"
18
+ "markdownlint-cli2": "markdownlint-cli2.js"
21
19
  },
22
20
  "homepage": "https://github.com/DavidAnson/markdownlint-cli2",
23
21
  "repository": {
@@ -25,16 +23,14 @@
25
23
  "url": "git+https://github.com/DavidAnson/markdownlint-cli2.git"
26
24
  },
27
25
  "bugs": "https://github.com/DavidAnson/markdownlint-cli2/issues",
26
+ "funding": "https://github.com/sponsors/DavidAnson",
28
27
  "scripts": {
29
28
  "build-docker-image": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker build -t davidanson/markdownlint-cli2:v$VERSION -f docker/Dockerfile --label org.opencontainers.image.version=v$VERSION .",
30
29
  "build-docker-image-rules": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker build -t davidanson/markdownlint-cli2-rules:v$VERSION -f docker/Dockerfile-rules --build-arg VERSION=v$VERSION --label org.opencontainers.image.version=v$VERSION .",
31
- "ci": "npm-run-all --continue-on-error --parallel test-cover lint schema",
32
- "docker-npm-install": "docker run --rm --tty --name npm-install --volume $PWD:/home/workdir --workdir /home/workdir --user node node:latest npm install",
33
- "docker-npm-run-upgrade": "docker run --rm --tty --name npm-run-upgrade --volume $PWD:/home/workdir --workdir /home/workdir --user node node:latest npm run upgrade",
30
+ "ci": "npm-run-all --continue-on-error --parallel test-cover lint schema && git diff --exit-code",
34
31
  "lint": "eslint --max-warnings 0 --no-eslintrc --config .eslintrc.json .",
35
32
  "lint-dockerfile": "docker run --rm -i hadolint/hadolint:latest-alpine < docker/Dockerfile",
36
33
  "lint-watch": "git ls-files | entr npm run lint",
37
- "publish-docker-image": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker buildx build --platform linux/arm64,linux/amd64 -t davidanson/markdownlint-cli2:v$VERSION -t davidanson/markdownlint-cli2:latest -f docker/Dockerfile --push .",
38
34
  "schema": "cpy ./node_modules/markdownlint/schema/markdownlint-config-schema.json ./schema --flat",
39
35
  "test": "ava --timeout=1m test/append-to-array-test.js test/fs-mock-test.js test/markdownlint-cli2-test.js test/markdownlint-cli2-test-exec.js test/markdownlint-cli2-test-fs.js test/markdownlint-cli2-test-main.js test/merge-options-test.js test/resolve-and-require-test.js",
40
36
  "test-cover": "c8 --100 npm test -- --concurrency=1",
@@ -45,12 +41,11 @@
45
41
  "test-invoke-as-cli": "markdownlint-cli2 CHANGELOG.md",
46
42
  "test-watch": "git ls-files | entr npm run test",
47
43
  "update-snapshots": "ava --timeout=1m --update-snapshots test/markdownlint-cli2-test-exec.js test/markdownlint-cli2-test-fs.js test/markdownlint-cli2-test-main.js",
48
- "upgrade": "npx --yes npm-check-updates --upgrade",
49
44
  "webworker": "cd webworker && webpack --mode none",
50
- "webworker-install": "npm run docker-npm-install -- --no-save path-browserify process setimmediate stream-browserify url util webpack-cli"
45
+ "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"
51
46
  },
52
47
  "engines": {
53
- "node": ">=16"
48
+ "node": ">=18"
54
49
  },
55
50
  "files": [
56
51
  "append-to-array.js",
@@ -59,44 +54,43 @@
59
54
  "export-markdownlint-helpers.js",
60
55
  "LICENSE",
61
56
  "markdownlint-cli2.js",
62
- "markdownlint-cli2-config.js",
63
- "markdownlint-cli2-fix.js",
64
57
  "merge-options.js",
65
58
  "README.md",
66
59
  "resolve-and-require.js",
67
60
  "schema/markdownlint-cli2-config-schema.json",
68
- "schema/markdownlint-config-schema.json"
61
+ "schema/markdownlint-config-schema.json",
62
+ "schema/ValidatingConfiguration.md"
69
63
  ],
70
64
  "dependencies": {
71
- "globby": "13.2.2",
72
- "markdownlint": "0.31.1",
65
+ "globby": "14.0.0",
66
+ "markdownlint": "0.33.0",
73
67
  "markdownlint-cli2-formatter-default": "0.0.4",
74
68
  "micromatch": "4.0.5",
75
69
  "strip-json-comments": "5.0.1",
76
- "yaml": "2.3.2"
70
+ "yaml": "2.3.4"
77
71
  },
78
72
  "devDependencies": {
79
73
  "@iktakahiro/markdown-it-katex": "4.0.1",
80
- "ava": "5.3.1",
81
- "c8": "8.0.1",
82
- "cpy": "10.1.0",
74
+ "ajv": "8.12.0",
75
+ "ava": "6.0.1",
76
+ "c8": "9.0.0",
77
+ "cpy": "11.0.0",
83
78
  "cpy-cli": "5.0.0",
84
79
  "del": "7.1.0",
85
- "eslint": "8.49.0",
86
- "eslint-plugin-n": "16.1.0",
87
- "eslint-plugin-unicorn": "48.0.1",
80
+ "eslint": "8.56.0",
81
+ "eslint-plugin-n": "16.6.2",
82
+ "eslint-plugin-unicorn": "50.0.1",
88
83
  "execa": "8.0.1",
89
- "markdown-it-emoji": "2.0.2",
90
- "markdown-it-for-inline": "0.1.1",
84
+ "markdown-it-emoji": "3.0.0",
85
+ "markdown-it-for-inline": "2.0.1",
91
86
  "markdownlint-cli2-formatter-codequality": "0.0.4",
92
87
  "markdownlint-cli2-formatter-json": "0.0.7",
93
- "markdownlint-cli2-formatter-junit": "0.0.7",
88
+ "markdownlint-cli2-formatter-junit": "0.0.8",
94
89
  "markdownlint-cli2-formatter-pretty": "0.0.5",
95
90
  "markdownlint-cli2-formatter-sarif": "0.0.1",
96
91
  "markdownlint-cli2-formatter-summarize": "0.0.6",
97
92
  "markdownlint-rule-titlecase": "0.1.0",
98
- "npm-run-all": "4.1.5",
99
- "tv4": "1.3.0"
93
+ "npm-run-all": "4.1.5"
100
94
  },
101
95
  "keywords": [
102
96
  "markdown",
@@ -6,12 +6,12 @@
6
6
  * Wrapper for calling Node's require.resolve/require with an additional path.
7
7
  * @param {Object} req Node's require implementation (or equivalent).
8
8
  * @param {String} id Package identifier to require.
9
- * @param {String} dir Directory to include when resolving paths.
9
+ * @param {String[]} dirs Directories to include when resolving paths.
10
10
  * @returns {Object} Exported module content.
11
11
  */
12
- const resolveAndRequire = (req, id, dir) => {
12
+ const resolveAndRequire = (req, id, dirs) => {
13
13
  const resolvePaths = req.resolve.paths ? req.resolve.paths("") : [];
14
- const paths = [ dir, ...resolvePaths ];
14
+ const paths = [ ...dirs, ...resolvePaths ];
15
15
  const resolved = req.resolve(id, { paths });
16
16
  return req(resolved);
17
17
  };
@@ -0,0 +1,24 @@
1
+ # Validating Configuration
2
+
3
+ A [JSON Schema][json-schema] is provided to enable validating options objects:
4
+ [`markdownlint-cli2-config-schema.json`][markdownlint-cli2-config-schema]
5
+
6
+ Some editors automatically use a JSON Schema with files that reference it. For
7
+ example, a `.markdownlint-cli2.jsonc` file with:
8
+
9
+ ```json
10
+ "$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-cli2-config-schema.json"
11
+ ```
12
+
13
+ A JSON Schema validator can be used to check configuration files like so:
14
+
15
+ ```bash
16
+ npx ajv-cli validate -s ./markdownlint-cli2/schema/markdownlint-cli2-config-schema.json -r ./markdownlint-cli2/schema/markdownlint-config-schema.json -d "**/.markdownlint-cli2.{jsonc,yaml}" --strict=false
17
+ ```
18
+
19
+ A similar process is documented for validating `markdownlint` configuration
20
+ objects: [Validating Configuration][validating-configuration].
21
+
22
+ [json-schema]: https://json-schema.org
23
+ [markdownlint-cli2-config-schema]: markdownlint-cli2-config-schema.json
24
+ [validating-configuration]: https://github.com/DavidAnson/markdownlint/blob/main/schema/ValidatingConfiguration.md
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.12.0/schema/markdownlint-cli2-config-schema.json",
3
4
  "title": "markdownlint-cli2 configuration schema",
4
5
  "type": "object",
5
6
  "properties": {
6
7
  "$schema": {
7
- "description": "JSON Schema URI (used by some editors)",
8
+ "description": "JSON Schema URI (expected by some editors)",
8
9
  "type": "string",
9
- "default": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-cli2-config-schema.json"
10
+ "default": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.12.0/schema/markdownlint-cli2-config-schema.json"
10
11
  },
11
12
  "config": {
12
13
  "description": "markdownlint-cli2 configuration schema",
13
- "$ref": "./markdownlint-config-schema.json",
14
+ "$ref": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.33.0/schema/markdownlint-config-schema.json",
14
15
  "default": {}
15
16
  },
16
17
  "customRules": {
@@ -74,6 +75,16 @@
74
75
  "minItems": 1
75
76
  }
76
77
  },
78
+ "modulePaths": {
79
+ "description": "Additional paths to resolve module locations from",
80
+ "type": "array",
81
+ "default": [],
82
+ "items": {
83
+ "description": "Path to resolve module locations from",
84
+ "type": "string",
85
+ "minLength": 1
86
+ }
87
+ },
77
88
  "noInlineConfig": {
78
89
  "description": "Whether to disable support of HTML comments within Markdown content",
79
90
  "type": "boolean",