@@ -67,9 +67,7 @@ As a [GitHub Action][github-action] via
67
67
markdownlint-cli2 vX.Y.Z (markdownlint vX.Y.Z)
68
68
https://github.com/DavidAnson/markdownlint-cli2
69
69
70
- Syntax: markdownlint-cli2 glob0 [glob1] [...] [globN]
71
- markdownlint-cli2-fix glob0 [glob1] [...] [globN]
72
- markdownlint-cli2-config config-file glob0 [glob1] [...] [globN]
70
+ Syntax: markdownlint-cli2 glob0 [glob1] [...] [globN] [--config file] [--fix]
73
71
74
72
Glob expressions (from the globby library):
75
73
- * matches any number of characters, but not /
@@ -84,6 +82,10 @@ Dot-only glob:
84
82
- Instead, it is mapped to "markdownlint-cli2 *.{md,markdown}" which lints all Markdown files in the current directory
85
83
- To lint every file in the current directory tree, the command "markdownlint-cli2 **" can be used instead
86
84
85
+ Optional parameters:
86
+ - --config specifies the path to a configuration file to define the base configuration
87
+ - --fix updates files to resolve fixable issues (can be overridden in configuration)
88
+
87
89
Configuration via:
88
90
- .markdownlint-cli2.jsonc
89
91
- .markdownlint-cli2.yaml
@@ -116,28 +118,47 @@ markdownlint-cli2 "**/*.md" "#node_modules"
116
118
` ` `
117
119
118
120
Because sharing the same configuration between "normal" and "fix" modes is
119
- common, the following command defaults the `fix` property (see below) to `true` :
121
+ common, the `--fix` argument can be used to default the `fix` property (see
122
+ below) to `true` (though it can still be overridden by a configuration file) :
120
123
121
124
` ` ` bash
122
- markdownlint-cli2-fix "**/*.md" "#node_modules"
125
+ markdownlint-cli2 - -fix "**/*.md" "#node_modules"
123
126
` ` `
124
127
125
- Other than the default behavior of the `fix` property (which can be overridden),
126
- these two commands behave identically.
128
+ > **Deprecated**
129
+ >
130
+ > The following command behaves similarly, defaulting the `fix` property to
131
+ > `true`:
132
+ >
133
+ > ```bash
134
+ > markdownlint-cli2-fix "**/*.md" "#node_modules"
135
+ > ```
136
+ >
137
+ > Otherwise, `markdownlint-cli2-fix` behaves the same as `markdownlint-cli2`.
127
138
128
139
In cases where it is not convenient to store a configuration file in the root
129
- of a project, the `markdownlint-cli2 -config` command can be used. This command
130
- accepts a path to any supported configuration file as its first argument :
140
+ of a project, the `- -config` argument can be used to provide a path to any
141
+ supported configuration file :
131
142
132
143
` ` ` bash
133
- markdownlint-cli2-config "config/.markdownlint-cli2.jsonc" "**/*.md" "#node_modules"
144
+ markdownlint-cli2 - -config "config/.markdownlint-cli2.jsonc" "**/*.md" "#node_modules"
134
145
` ` `
135
146
136
- The configuration file name must be (or end with) one of the supported types
147
+ The configuration file name must be (or end with) one of the supported names
137
148
above. For example, `.markdownlint.json` or `example.markdownlint-cli2.jsonc`.
138
149
The specified configuration file will be loaded, parsed, and applied as a base
139
150
configuration for the current directory - which will then be handled normally.
140
- Otherwise, this command behaves identically to `markdownlint-cli2`.
151
+
152
+ > **Deprecated**
153
+ >
154
+ > The following command behaves similarly, accepting a base configuration file
155
+ > path as its first parameter:
156
+ >
157
+ > ```bash
158
+ > markdownlint-cli2-config "config/.markdownlint-cli2.jsonc" "**/*.md" "#node_modules"
159
+ > ```
160
+ >
161
+ > Otherwise, `markdownlint-cli2-config` behaves the same as `markdownlint-cli2`.
141
162
142
163
# ## Container Image
143
164
@@ -165,12 +186,14 @@ Notes:
165
186
docker run -w /myfolder -v $PWD:/myfolder davidanson/markdownlint-cli2:v0.7.1 "**/*.md" "#node_modules"
166
187
` ` `
167
188
168
- To invoke the `markdownlint-cli2-config` or `markdownlint-cli2-fix` commands
169
- instead, use Docker's `--entrypoint` flag :
170
-
171
- ` ` ` bash
172
- docker run -v $PWD:/workdir --entrypoint="markdownlint-cli2-fix" davidanson/markdownlint-cli2:v0.7.1 "**/*.md" "#node_modules"
173
- ` ` `
189
+ > **Deprecated**
190
+ >
191
+ > To invoke the `markdownlint-cli2-config` or `markdownlint-cli2-fix` commands
192
+ > instead, use Docker's `--entrypoint` flag:
193
+ >
194
+ > ```bash
195
+ > docker run -v $PWD:/workdir --entrypoint="markdownlint-cli2-fix" davidanson/markdownlint-cli2:v0.7.1 "**/*.md" "#node_modules"
196
+ > ```
174
197
175
198
For convenience, the container image
176
199
[`davidanson/markdownlint-cli2-rules`][docker-hub-markdownlint-cli2-rules]
0 commit comments