markdownlint-cli2 0.9.2 → 0.10.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 ADDED
@@ -0,0 +1,155 @@
1
+ # Changelog
2
+
3
+ ## 0.10.0
4
+
5
+ - Add `showFound` configuration option
6
+ - Add `.markdownlint-cli2.jsonc` config schema
7
+ - Update dependencies (including `markdownlint`)
8
+
9
+ ## 0.9.2
10
+
11
+ - Remove `npm-shrinkwrap.json` entirely to avoid `npm` failures
12
+
13
+ ## 0.9.1
14
+
15
+ - Remove `devDependencies` from `npm-shrinkwrap.json` to avoid `npm` failures
16
+
17
+ ## 0.9.0
18
+
19
+ - Add support for Node.js's `package.json` as a configuration file source
20
+ - Add output formatter for Static Analysis Results Interchange Format/SARIF
21
+ - Bundle `npm-shrinkwrap.json` for reproducible/faster installs
22
+ - Update dependencies (including `markdownlint`)
23
+
24
+ ## 0.8.1
25
+
26
+ - Handle `--config` edge case
27
+
28
+ ## 0.8.0
29
+
30
+ - Add support for `--config` and `--fix` parameters
31
+ - Update dependencies (including `markdownlint`)
32
+ - Remove support for end-of-life Node 14
33
+
34
+ ## 0.7.1
35
+
36
+ - Update dependencies (including `markdownlint`)
37
+
38
+ ## 0.7.0
39
+
40
+ - Add support for `extends` in `config` property of `.markdownlint-cli2.*` files
41
+ - Build and publish `davidanson/markdownlint-cli2-rules` Docker container image
42
+ - Update dependencies (including `markdownlint`)
43
+
44
+ ## 0.6.0
45
+
46
+ - Update dependencies (including `markdownlint`)
47
+
48
+ ## 0.5.1
49
+
50
+ - Update dependencies
51
+
52
+ ## 0.5.0
53
+
54
+ - New rules
55
+ - Support modules (MJS) everywhere
56
+ - Include dotfiles
57
+
58
+ ## 0.4.0
59
+
60
+ - New rules
61
+ - Async custom rules
62
+ - Explicit config
63
+ - CJS (breaking)
64
+
65
+ ## 0.3.2
66
+
67
+ - Extensibility/Windows/consistency improvements
68
+
69
+ ## 0.3.1
70
+
71
+ - Extensibility tweaks
72
+
73
+ ## 0.3.0
74
+
75
+ - Add Docker container
76
+ - Update dependencies
77
+
78
+ ## 0.2.0
79
+
80
+ - Improve handling of Windows paths using backslash
81
+
82
+ ## 0.1.3
83
+
84
+ - Support rule collections
85
+
86
+ ## 0.1.2
87
+
88
+ - Update use of `require` to be more flexible
89
+
90
+ ## 0.1.1
91
+
92
+ - Restore previous use of `require`
93
+
94
+ ## 0.1.0
95
+
96
+ - Simplify use of `require`
97
+ - Increment minor version
98
+
99
+ ## 0.0.15
100
+
101
+ - Improve extensibility
102
+
103
+ ## 0.0.14
104
+
105
+ - Update dependencies (including `markdownlint`)
106
+
107
+ ## 0.0.13
108
+
109
+ - Add `markdownlint-cli2-fix` command
110
+
111
+ ## 0.0.12
112
+
113
+ - Update dependencies (including `markdownlint`)
114
+
115
+ ## 0.0.11
116
+
117
+ - Improve performance of `fix`
118
+ - Update banner
119
+
120
+ ## 0.0.10
121
+
122
+ - Improve performance and configuration
123
+
124
+ ## 0.0.9
125
+
126
+ - Improve configuration file handling
127
+
128
+ ## 0.0.8
129
+
130
+ - Support `.markdownlint-cli2.yaml`
131
+ - Add progress
132
+
133
+ ## 0.0.7
134
+
135
+ - Support `.markdownlint-cli2.js` and `.markdownlint.js`
136
+
137
+ ## 0.0.6
138
+
139
+ - Improve handling of very large directory trees
140
+
141
+ ## 0.0.5
142
+
143
+ - Improve support for ignoring files
144
+
145
+ ## 0.0.4
146
+
147
+ - Support output formatters and `markdown-it` plugins
148
+
149
+ ## 0.0.3
150
+
151
+ - Feature parity with `markdownlint-cli`
152
+
153
+ ## 0.0.2
154
+
155
+ - Initial release
package/README.md CHANGED
@@ -167,7 +167,7 @@ A container image [`davidanson/markdownlint-cli2`][docker-hub-markdownlint-cli2]
167
167
  can also be used (e.g., as part of a CI pipeline):
168
168
 
169
169
  ```bash
170
- docker run -v $PWD:/workdir davidanson/markdownlint-cli2:v0.9.2 "**/*.md" "#node_modules"
170
+ docker run -v $PWD:/workdir davidanson/markdownlint-cli2:v0.10.0 "**/*.md" "#node_modules"
171
171
  ```
172
172
 
173
173
  Notes:
@@ -184,7 +184,7 @@ Notes:
184
184
  - A custom working directory can be specified with Docker's `-w` flag:
185
185
 
186
186
  ```bash
187
- docker run -w /myfolder -v $PWD:/myfolder davidanson/markdownlint-cli2:v0.9.2 "**/*.md" "#node_modules"
187
+ docker run -w /myfolder -v $PWD:/myfolder davidanson/markdownlint-cli2:v0.10.0 "**/*.md" "#node_modules"
188
188
  ```
189
189
 
190
190
  > **Deprecated**
@@ -193,7 +193,7 @@ Notes:
193
193
  > instead, use Docker's `--entrypoint` flag:
194
194
  >
195
195
  > ```bash
196
- > docker run -v $PWD:/workdir --entrypoint="markdownlint-cli2-fix" davidanson/markdownlint-cli2:v0.9.2 "**/*.md" "#node_modules"
196
+ > docker run -v $PWD:/workdir --entrypoint="markdownlint-cli2-fix" davidanson/markdownlint-cli2:v0.10.0 "**/*.md" "#node_modules"
197
197
  > ```
198
198
 
199
199
  For convenience, the container image
@@ -320,6 +320,9 @@ of the rules within.
320
320
  - This top-level setting is valid **only** in the directory from which
321
321
  `markdownlint-cli2` is run
322
322
  - Search [`markdownlint-cli2-formatter` on npm][markdownlint-cli2-formatter]
323
+ - `showFound`: `Boolean` value to display the list of found files on `stdout`
324
+ - This top-level setting is valid **only** in the directory from which
325
+ `markdownlint-cli2` is run and **only** when `noProgress` has not been set
323
326
  - When referencing a module via the `customRules`, `markdownItPlugins`, or
324
327
  `outputFormatters` properties, each `String` identifier is passed to Node's
325
328
  [`require` function][nodejs-require] then (if that failed) its
@@ -412,7 +415,7 @@ reference to the `repos` list in that project's `.pre-commit-config.yaml` like:
412
415
 
413
416
  ```yaml
414
417
  - repo: https://github.com/DavidAnson/markdownlint-cli2
415
- rev: v0.9.2
418
+ rev: v0.10.0
416
419
  hooks:
417
420
  - id: markdownlint-cli2
418
421
  ```
@@ -26,7 +26,7 @@ const resolveAndRequire = require("./resolve-and-require");
26
26
 
27
27
  // Variables
28
28
  const packageName = "markdownlint-cli2";
29
- const packageVersion = "0.9.2";
29
+ const packageVersion = "0.10.0";
30
30
  const libraryName = "markdownlint";
31
31
  const libraryVersion = markdownlintLibrary.getVersion();
32
32
  const dotOnlySubstitute = "*.{md,markdown}";
@@ -950,9 +950,15 @@ const main = async (params) => {
950
950
  );
951
951
  // Output linting status
952
952
  if (showProgress) {
953
- let fileCount = 0;
954
- for (const dirInfo of dirInfos) {
955
- fileCount += dirInfo.files.length;
953
+ const fileNames = dirInfos.flatMap((dirInfo) => {
954
+ const { files } = dirInfo;
955
+ return files.map((file) => pathPosix.relative(baseDir, file));
956
+ });
957
+ const fileCount = fileNames.length;
958
+ if (baseMarkdownlintOptions.showFound) {
959
+ fileNames.push("");
960
+ fileNames.sort();
961
+ logMessage(`Found:${fileNames.join("\n ")}`);
956
962
  }
957
963
  logMessage(`Linting: ${fileCount} file(s)`);
958
964
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdownlint-cli2",
3
- "version": "0.9.2",
3
+ "version": "0.10.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",
@@ -22,25 +22,27 @@
22
22
  "homepage": "https://github.com/DavidAnson/markdownlint-cli2",
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://github.com/DavidAnson/markdownlint-cli2.git"
25
+ "url": "git+https://github.com/DavidAnson/markdownlint-cli2.git"
26
26
  },
27
27
  "bugs": "https://github.com/DavidAnson/markdownlint-cli2/issues",
28
28
  "scripts": {
29
29
  "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
30
  "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",
31
+ "ci": "npm-run-all --continue-on-error --parallel test-cover lint schema",
32
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
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",
34
34
  "lint": "eslint --max-warnings 0 --no-eslintrc --config .eslintrc.json .",
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
  "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
+ "schema": "cpy ./node_modules/markdownlint/schema/markdownlint-config-schema.json ./schema --flat",
38
39
  "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",
39
- "test-docker-image": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker run --rm -v $PWD:/workdir davidanson/markdownlint-cli2:v$VERSION \"*.md\"",
40
- "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\"",
40
+ "test-cover": "c8 --100 npm test -- --concurrency=1",
41
41
  "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\"",
42
42
  "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\"",
43
- "test-cover": "c8 --100 npm test -- --concurrency=1",
43
+ "test-docker-image": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker run --rm -v $PWD:/workdir davidanson/markdownlint-cli2:v$VERSION \"*.md\"",
44
+ "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\"",
45
+ "test-invoke-as-cli": "markdownlint-cli2 CHANGELOG.md",
44
46
  "test-watch": "git ls-files | entr npm run test",
45
47
  "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",
46
48
  "upgrade": "npx --yes npm-check-updates --upgrade",
@@ -52,30 +54,36 @@
52
54
  },
53
55
  "files": [
54
56
  "append-to-array.js",
57
+ "CHANGELOG.md",
55
58
  "export-markdownlint.js",
56
59
  "export-markdownlint-helpers.js",
60
+ "LICENSE",
57
61
  "markdownlint-cli2.js",
58
62
  "markdownlint-cli2-config.js",
59
63
  "markdownlint-cli2-fix.js",
60
64
  "merge-options.js",
61
- "resolve-and-require.js"
65
+ "README.md",
66
+ "resolve-and-require.js",
67
+ "schema/markdownlint-cli2-config-schema.json",
68
+ "schema/markdownlint-config-schema.json"
62
69
  ],
63
70
  "dependencies": {
64
71
  "globby": "13.2.2",
65
- "markdownlint": "0.30.0",
72
+ "markdownlint": "0.31.1",
66
73
  "markdownlint-cli2-formatter-default": "0.0.4",
67
74
  "micromatch": "4.0.5",
68
75
  "strip-json-comments": "5.0.1",
69
- "yaml": "2.3.1"
76
+ "yaml": "2.3.2"
70
77
  },
71
78
  "devDependencies": {
72
79
  "@iktakahiro/markdown-it-katex": "4.0.1",
73
80
  "ava": "5.3.1",
74
81
  "c8": "8.0.1",
75
82
  "cpy": "10.1.0",
76
- "del": "7.0.0",
77
- "eslint": "8.47.0",
78
- "eslint-plugin-n": "16.0.2",
83
+ "cpy-cli": "5.0.0",
84
+ "del": "7.1.0",
85
+ "eslint": "8.49.0",
86
+ "eslint-plugin-n": "16.1.0",
79
87
  "eslint-plugin-unicorn": "48.0.1",
80
88
  "execa": "8.0.1",
81
89
  "markdown-it-emoji": "2.0.2",
@@ -87,7 +95,8 @@
87
95
  "markdownlint-cli2-formatter-sarif": "0.0.1",
88
96
  "markdownlint-cli2-formatter-summarize": "0.0.6",
89
97
  "markdownlint-rule-titlecase": "0.1.0",
90
- "npm-run-all": "4.1.5"
98
+ "npm-run-all": "4.1.5",
99
+ "tv4": "1.3.0"
91
100
  },
92
101
  "keywords": [
93
102
  "markdown",
@@ -0,0 +1,114 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "markdownlint-cli2 configuration schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "description": "JSON Schema URI (used by some editors)",
8
+ "type": "string",
9
+ "default": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-cli2-config-schema.json"
10
+ },
11
+ "config": {
12
+ "description": "markdownlint-cli2 configuration schema",
13
+ "$ref": "./markdownlint-config-schema.json",
14
+ "default": {}
15
+ },
16
+ "customRules": {
17
+ "description": "Module names or paths of custom rules to load and use when linting",
18
+ "type": "array",
19
+ "default": [],
20
+ "items": {
21
+ "description": "Module name or path of a custom rule",
22
+ "type": "string",
23
+ "minLength": 1
24
+ }
25
+ },
26
+ "fix": {
27
+ "description": "Whether to enable fixing of linting errors reported by rules that emit fix information",
28
+ "type": "boolean",
29
+ "default": false
30
+ },
31
+ "frontMatter": {
32
+ "description": "Regular expression used to match and ignore any front matter at the beginning of a document",
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "default": ""
36
+ },
37
+ "globs": {
38
+ "description": "Glob expressions to include when linting (only valid at the root)",
39
+ "type": "array",
40
+ "default": [],
41
+ "items": {
42
+ "description": "Glob expression of files to lint",
43
+ "type": "string",
44
+ "minLength": 1
45
+ }
46
+ },
47
+ "ignores": {
48
+ "description": "Glob expressions to ignore when linting",
49
+ "type": "array",
50
+ "default": [],
51
+ "items": {
52
+ "description": "Glob expression of files to ignore",
53
+ "type": "string",
54
+ "minLength": 1
55
+ }
56
+ },
57
+ "markdownItPlugins": {
58
+ "description": "markdown-it plugins to load and use when linting",
59
+ "type": "array",
60
+ "default": [],
61
+ "items": {
62
+ "description": "Name or path of a markdown-it plugin followed by parameters",
63
+ "type": "array",
64
+ "items": [
65
+ {
66
+ "description": "Name or path of a markdown-it plugin",
67
+ "type": "string",
68
+ "minLength": 1
69
+ },
70
+ {
71
+ "description": "Parameter(s) to pass to the markdown-it plugin"
72
+ }
73
+ ],
74
+ "minItems": 1
75
+ }
76
+ },
77
+ "noInlineConfig": {
78
+ "description": "Whether to disable support of HTML comments within Markdown content",
79
+ "type": "boolean",
80
+ "default": false
81
+ },
82
+ "noProgress": {
83
+ "description": "Whether to disable the display of progress on stdout (only valid at the root)",
84
+ "type": "boolean",
85
+ "default": false
86
+ },
87
+ "outputFormatters": {
88
+ "description": "Output formatters to load and use to customize markdownlint-cli2 output (only valid at the root)",
89
+ "type": "array",
90
+ "default": [],
91
+ "items": {
92
+ "description": "Name or path of an output formatter followed by parameters",
93
+ "type": "array",
94
+ "items": [
95
+ {
96
+ "description": "Name or path of an output formatter",
97
+ "type": "string",
98
+ "minLength": 1
99
+ },
100
+ {
101
+ "description": "Parameter(s) to pass to the output formatter"
102
+ }
103
+ ],
104
+ "minItems": 1
105
+ }
106
+ },
107
+ "showFound": {
108
+ "description": "Whether to show the list of found files on stdout (only valid at the root)",
109
+ "type": "boolean",
110
+ "default": false
111
+ }
112
+ },
113
+ "additionalProperties": false
114
+ }