markdownlint-cli2 0.5.1 → 0.6.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 +28 -9
- package/markdownlint-cli2.js +5 -8
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -10,22 +10,36 @@
|
|
|
10
10
|
|
|
11
11
|
As a global CLI:
|
|
12
12
|
|
|
13
|
-
```
|
|
13
|
+
```bash
|
|
14
14
|
npm install markdownlint-cli2 --global
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
As a development dependency of the current package:
|
|
17
|
+
As a development dependency of the current [Node.js][nodejs] package:
|
|
18
18
|
|
|
19
|
-
```
|
|
19
|
+
```bash
|
|
20
20
|
npm install markdownlint-cli2 --save-dev
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
As a [Docker][docker] container image:
|
|
24
24
|
|
|
25
|
-
```
|
|
25
|
+
```bash
|
|
26
26
|
docker pull davidanson/markdownlint-cli2
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
As a global CLI with [Homebrew][homebrew]:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
brew install markdownlint-cli2
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
As a [GitHub Action][github-action] via
|
|
36
|
+
[`markdownlint-cli2-action`][markdownlint-cli2-action]:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
- name: markdownlint-cli2-action
|
|
40
|
+
uses: DavidAnson/markdownlint-cli2-action
|
|
41
|
+
```
|
|
42
|
+
|
|
29
43
|
## Overview
|
|
30
44
|
|
|
31
45
|
- [`markdownlint`][markdownlint] is a library for linting [Markdown][markdown]/
|
|
@@ -131,7 +145,7 @@ A container image [`davidanson/markdownlint-cli2`][docker-hub-markdownlint-cli2]
|
|
|
131
145
|
can also be used (e.g., as part of a CI pipeline):
|
|
132
146
|
|
|
133
147
|
```bash
|
|
134
|
-
docker run -v $PWD:/workdir davidanson/markdownlint-cli2:
|
|
148
|
+
docker run -v $PWD:/workdir davidanson/markdownlint-cli2:v0.6.0 "**/*.md" "#node_modules"
|
|
135
149
|
```
|
|
136
150
|
|
|
137
151
|
Notes:
|
|
@@ -148,14 +162,14 @@ Notes:
|
|
|
148
162
|
- A custom working directory can be specified with Docker's `-w` flag:
|
|
149
163
|
|
|
150
164
|
```bash
|
|
151
|
-
docker run -w /myfolder -v $PWD:/myfolder davidanson/markdownlint-cli2:
|
|
165
|
+
docker run -w /myfolder -v $PWD:/myfolder davidanson/markdownlint-cli2:v0.6.0 "**/*.md" "#node_modules"
|
|
152
166
|
```
|
|
153
167
|
|
|
154
168
|
To invoke the `markdownlint-cli2-config` or `markdownlint-cli2-fix` commands
|
|
155
169
|
instead, use Docker's `--entrypoint` flag:
|
|
156
170
|
|
|
157
171
|
```bash
|
|
158
|
-
docker run -v $PWD:/workdir --entrypoint="markdownlint-cli2-fix" davidanson/markdownlint-cli2:
|
|
172
|
+
docker run -v $PWD:/workdir --entrypoint="markdownlint-cli2-fix" davidanson/markdownlint-cli2:v0.6.0 "**/*.md" "#node_modules"
|
|
159
173
|
```
|
|
160
174
|
|
|
161
175
|
### Exit Codes
|
|
@@ -344,7 +358,7 @@ reference to the `repos` list in that project's `.pre-commit-config.yaml` like:
|
|
|
344
358
|
|
|
345
359
|
```yaml
|
|
346
360
|
- repo: https://github.com/DavidAnson/markdownlint-cli2
|
|
347
|
-
rev: v0.
|
|
361
|
+
rev: v0.6.0
|
|
348
362
|
hooks:
|
|
349
363
|
- id: markdownlint-cli2
|
|
350
364
|
```
|
|
@@ -379,16 +393,20 @@ reference to the `repos` list in that project's `.pre-commit-config.yaml` like:
|
|
|
379
393
|
- 0.4.0 - New rules, async custom rules, explicit config, CJS (breaking)
|
|
380
394
|
- 0.5.0 - New rules, support modules (MJS) everywhere, include dotfiles
|
|
381
395
|
- 0.5.1 - Update dependencies
|
|
396
|
+
- 0.6.0 - Update dependencies (including `markdownlint`)
|
|
382
397
|
|
|
383
398
|
<!-- markdownlint-disable line-length -->
|
|
384
399
|
|
|
385
400
|
[commonmark]: https://commonmark.org/
|
|
386
401
|
[commonjs-module]: https://nodejs.org/api/modules.html#modules_modules_commonjs_modules
|
|
387
402
|
[ecmascript-module]: https://nodejs.org/api/esm.html#modules-ecmascript-modules
|
|
403
|
+
[docker]: https://www.docker.com
|
|
388
404
|
[docker-bind-mounts]: https://docs.docker.com/storage/bind-mounts/
|
|
389
405
|
[docker-hub-markdownlint-cli2]: https://hub.docker.com/r/davidanson/markdownlint-cli2
|
|
390
406
|
[front-matter]: https://jekyllrb.com/docs/frontmatter/
|
|
407
|
+
[github-action]: https://docs.github.com/actions
|
|
391
408
|
[globby]: https://www.npmjs.com/package/globby
|
|
409
|
+
[homebrew]: https://brew.sh
|
|
392
410
|
[html-comment]: https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started
|
|
393
411
|
[json]: https://wikipedia.org/wiki/JSON
|
|
394
412
|
[jsonc]: https://code.visualstudio.com/Docs/languages/json#_json-with-comments
|
|
@@ -407,6 +425,7 @@ reference to the `repos` list in that project's `.pre-commit-config.yaml` like:
|
|
|
407
425
|
[markdownlint-rules-tags]: https://github.com/DavidAnson/markdownlint/blob/main/README.md#tags
|
|
408
426
|
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
|
|
409
427
|
[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2
|
|
428
|
+
[markdownlint-cli2-action]: https://github.com/marketplace/actions/markdownlint-cli2-action
|
|
410
429
|
[markdownlint-cli2-blog]: https://dlaa.me/blog/post/markdownlintcli2
|
|
411
430
|
[markdownlint-cli2-formatter]: https://www.npmjs.com/search?q=keywords:markdownlint-cli2-formatter
|
|
412
431
|
[markdownlint-cli2-cjs]: test/markdownlint-cli2-cjs/.markdownlint-cli2.cjs
|
package/markdownlint-cli2.js
CHANGED
|
@@ -22,7 +22,7 @@ const resolveAndRequire = require("./resolve-and-require");
|
|
|
22
22
|
|
|
23
23
|
// Variables
|
|
24
24
|
const packageName = "markdownlint-cli2";
|
|
25
|
-
const packageVersion = "0.
|
|
25
|
+
const packageVersion = "0.6.0";
|
|
26
26
|
const libraryName = "markdownlint";
|
|
27
27
|
const libraryVersion = markdownlintLibrary.getVersion();
|
|
28
28
|
const dotOnlySubstitute = "*.{md,markdown}";
|
|
@@ -34,8 +34,7 @@ const noop = () => null;
|
|
|
34
34
|
// Gets a synchronous function to parse JSONC text
|
|
35
35
|
const getJsoncParse = async () => {
|
|
36
36
|
const { "default": stripJsonComments } =
|
|
37
|
-
// eslint-disable-next-line
|
|
38
|
-
// eslint-disable-next-line no-inline-comments, node/no-unsupported-features/es-syntax
|
|
37
|
+
// eslint-disable-next-line no-inline-comments
|
|
39
38
|
await import(/* webpackMode: "eager" */ "strip-json-comments");
|
|
40
39
|
return (text) => JSON.parse(stripJsonComments(text));
|
|
41
40
|
};
|
|
@@ -79,8 +78,7 @@ const importOrRequireResolve = async (dir, id) => {
|
|
|
79
78
|
try {
|
|
80
79
|
const fileUrlString =
|
|
81
80
|
pathToFileURL(path.resolve(dir, expandId)).toString();
|
|
82
|
-
// eslint-disable-next-line
|
|
83
|
-
// eslint-disable-next-line no-inline-comments, node/no-unsupported-features/es-syntax
|
|
81
|
+
// eslint-disable-next-line no-inline-comments
|
|
84
82
|
const module = await import(/* webpackIgnore: true */ fileUrlString);
|
|
85
83
|
return module.default;
|
|
86
84
|
} catch (error) {
|
|
@@ -446,8 +444,7 @@ async (fs, baseDirSystem, baseDir, globPatterns, dirToDirInfo, noErrors, noRequi
|
|
|
446
444
|
})
|
|
447
445
|
);
|
|
448
446
|
// Process glob patterns
|
|
449
|
-
// eslint-disable-next-line
|
|
450
|
-
// eslint-disable-next-line no-inline-comments, node/no-unsupported-features/es-syntax
|
|
447
|
+
// eslint-disable-next-line no-inline-comments
|
|
451
448
|
const { globby } = await import(/* webpackMode: "eager" */ "globby");
|
|
452
449
|
const files = [
|
|
453
450
|
...await globby(expandedDirectories, globbyOptions),
|
|
@@ -678,7 +675,7 @@ const lintFiles = async (fs, dirInfos, fileContents) => {
|
|
|
678
675
|
"files": filteredFiles,
|
|
679
676
|
"strings": filteredStrings,
|
|
680
677
|
"config": markdownlintConfig || markdownlintOptions.config,
|
|
681
|
-
"configParsers": [ jsoncParse ],
|
|
678
|
+
"configParsers": [ jsoncParse, yamlParse ],
|
|
682
679
|
"customRules": markdownlintOptions.customRules,
|
|
683
680
|
"frontMatter": markdownlintOptions.frontMatter
|
|
684
681
|
? new RegExp(markdownlintOptions.frontMatter, "u")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdownlint-cli2",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"webworker-install": "npm run docker-npm-install -- --no-save path-browserify process setimmediate stream-browserify url util webpack-cli"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
|
-
"node": ">=14"
|
|
44
|
+
"node": ">=14.18.0"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
47
|
"append-to-array.js",
|
|
@@ -52,25 +52,26 @@
|
|
|
52
52
|
"resolve-and-require.js"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"globby": "13.1.
|
|
56
|
-
"markdownlint": "0.
|
|
55
|
+
"globby": "13.1.3",
|
|
56
|
+
"markdownlint": "0.27.0",
|
|
57
57
|
"markdownlint-cli2-formatter-default": "0.0.3",
|
|
58
58
|
"micromatch": "4.0.5",
|
|
59
59
|
"strip-json-comments": "5.0.0",
|
|
60
|
-
"yaml": "2.
|
|
60
|
+
"yaml": "2.2.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@iktakahiro/markdown-it-katex": "4.0.1",
|
|
64
|
-
"ava": "
|
|
64
|
+
"ava": "5.1.0",
|
|
65
65
|
"c8": "7.12.0",
|
|
66
66
|
"cpy": "9.0.1",
|
|
67
67
|
"del": "7.0.0",
|
|
68
|
-
"eslint": "8.
|
|
69
|
-
"eslint-plugin-
|
|
70
|
-
"eslint-plugin-unicorn": "
|
|
68
|
+
"eslint": "8.30.0",
|
|
69
|
+
"eslint-plugin-n": "15.6.0",
|
|
70
|
+
"eslint-plugin-unicorn": "45.0.2",
|
|
71
71
|
"execa": "6.1.0",
|
|
72
72
|
"markdown-it-emoji": "2.0.2",
|
|
73
73
|
"markdown-it-for-inline": "0.1.1",
|
|
74
|
+
"markdownlint-cli2-formatter-codequality": "0.0.1",
|
|
74
75
|
"markdownlint-cli2-formatter-json": "0.0.6",
|
|
75
76
|
"markdownlint-cli2-formatter-junit": "0.0.5",
|
|
76
77
|
"markdownlint-cli2-formatter-pretty": "0.0.3",
|