markdownlint-cli2 0.5.0 → 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 CHANGED
@@ -10,22 +10,36 @@
10
10
 
11
11
  As a global CLI:
12
12
 
13
- ```shell
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
- ```shell
19
+ ```bash
20
20
  npm install markdownlint-cli2 --save-dev
21
21
  ```
22
22
 
23
- Or as a Docker container image:
23
+ As a [Docker][docker] container image:
24
24
 
25
- ```shell
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:0.5.0 "**/*.md" "#node_modules"
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:0.5.0 "**/*.md" "#node_modules"
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:0.5.0 "**/*.md" "#node_modules"
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.5.0
361
+ rev: v0.6.0
348
362
  hooks:
349
363
  - id: markdownlint-cli2
350
364
  ```
@@ -378,16 +392,21 @@ reference to the `repos` list in that project's `.pre-commit-config.yaml` like:
378
392
  - 0.3.2 - Extensibility/Windows/consistency improvements
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
395
+ - 0.5.1 - Update dependencies
396
+ - 0.6.0 - Update dependencies (including `markdownlint`)
381
397
 
382
398
  <!-- markdownlint-disable line-length -->
383
399
 
384
400
  [commonmark]: https://commonmark.org/
385
401
  [commonjs-module]: https://nodejs.org/api/modules.html#modules_modules_commonjs_modules
386
402
  [ecmascript-module]: https://nodejs.org/api/esm.html#modules-ecmascript-modules
403
+ [docker]: https://www.docker.com
387
404
  [docker-bind-mounts]: https://docs.docker.com/storage/bind-mounts/
388
405
  [docker-hub-markdownlint-cli2]: https://hub.docker.com/r/davidanson/markdownlint-cli2
389
406
  [front-matter]: https://jekyllrb.com/docs/frontmatter/
407
+ [github-action]: https://docs.github.com/actions
390
408
  [globby]: https://www.npmjs.com/package/globby
409
+ [homebrew]: https://brew.sh
391
410
  [html-comment]: https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started
392
411
  [json]: https://wikipedia.org/wiki/JSON
393
412
  [jsonc]: https://code.visualstudio.com/Docs/languages/json#_json-with-comments
@@ -406,6 +425,7 @@ reference to the `repos` list in that project's `.pre-commit-config.yaml` like:
406
425
  [markdownlint-rules-tags]: https://github.com/DavidAnson/markdownlint/blob/main/README.md#tags
407
426
  [markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
408
427
  [markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2
428
+ [markdownlint-cli2-action]: https://github.com/marketplace/actions/markdownlint-cli2-action
409
429
  [markdownlint-cli2-blog]: https://dlaa.me/blog/post/markdownlintcli2
410
430
  [markdownlint-cli2-formatter]: https://www.npmjs.com/search?q=keywords:markdownlint-cli2-formatter
411
431
  [markdownlint-cli2-cjs]: test/markdownlint-cli2-cjs/.markdownlint-cli2.cjs
@@ -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.5.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 max-len
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,8 @@ 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 node/no-unsupported-features/es-syntax
83
- const module = await import(fileUrlString);
81
+ // eslint-disable-next-line no-inline-comments
82
+ const module = await import(/* webpackIgnore: true */ fileUrlString);
84
83
  return module.default;
85
84
  } catch (error) {
86
85
  errors.push(error);
@@ -445,8 +444,7 @@ async (fs, baseDirSystem, baseDir, globPatterns, dirToDirInfo, noErrors, noRequi
445
444
  })
446
445
  );
447
446
  // Process glob patterns
448
- // eslint-disable-next-line max-len
449
- // eslint-disable-next-line no-inline-comments, node/no-unsupported-features/es-syntax
447
+ // eslint-disable-next-line no-inline-comments
450
448
  const { globby } = await import(/* webpackMode: "eager" */ "globby");
451
449
  const files = [
452
450
  ...await globby(expandedDirectories, globbyOptions),
@@ -677,7 +675,7 @@ const lintFiles = async (fs, dirInfos, fileContents) => {
677
675
  "files": filteredFiles,
678
676
  "strings": filteredStrings,
679
677
  "config": markdownlintConfig || markdownlintOptions.config,
680
- "configParsers": [ jsoncParse ],
678
+ "configParsers": [ jsoncParse, yamlParse ],
681
679
  "customRules": markdownlintOptions.customRules,
682
680
  "frontMatter": markdownlintOptions.frontMatter
683
681
  ? new RegExp(markdownlintOptions.frontMatter, "u")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdownlint-cli2",
3
- "version": "0.5.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",
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "license": "MIT",
10
10
  "type": "commonjs",
11
+ "main": "./markdownlint-cli2.js",
11
12
  "exports": "./markdownlint-cli2.js",
12
13
  "bin": {
13
14
  "markdownlint-cli2": "markdownlint-cli2.js",
@@ -40,7 +41,7 @@
40
41
  "webworker-install": "npm run docker-npm-install -- --no-save path-browserify process setimmediate stream-browserify url util webpack-cli"
41
42
  },
42
43
  "engines": {
43
- "node": ">=14"
44
+ "node": ">=14.18.0"
44
45
  },
45
46
  "files": [
46
47
  "append-to-array.js",
@@ -51,25 +52,26 @@
51
52
  "resolve-and-require.js"
52
53
  ],
53
54
  "dependencies": {
54
- "globby": "13.1.2",
55
- "markdownlint": "0.26.1",
55
+ "globby": "13.1.3",
56
+ "markdownlint": "0.27.0",
56
57
  "markdownlint-cli2-formatter-default": "0.0.3",
57
58
  "micromatch": "4.0.5",
58
59
  "strip-json-comments": "5.0.0",
59
- "yaml": "2.1.1"
60
+ "yaml": "2.2.1"
60
61
  },
61
62
  "devDependencies": {
62
63
  "@iktakahiro/markdown-it-katex": "4.0.1",
63
- "ava": "4.3.1",
64
+ "ava": "5.1.0",
64
65
  "c8": "7.12.0",
65
66
  "cpy": "9.0.1",
66
67
  "del": "7.0.0",
67
- "eslint": "8.20.0",
68
- "eslint-plugin-node": "11.1.0",
69
- "eslint-plugin-unicorn": "43.0.2",
68
+ "eslint": "8.30.0",
69
+ "eslint-plugin-n": "15.6.0",
70
+ "eslint-plugin-unicorn": "45.0.2",
70
71
  "execa": "6.1.0",
71
72
  "markdown-it-emoji": "2.0.2",
72
73
  "markdown-it-for-inline": "0.1.1",
74
+ "markdownlint-cli2-formatter-codequality": "0.0.1",
73
75
  "markdownlint-cli2-formatter-json": "0.0.6",
74
76
  "markdownlint-cli2-formatter-junit": "0.0.5",
75
77
  "markdownlint-cli2-formatter-pretty": "0.0.3",