Skip to content

Commit 86a9696

Browse files
authored
enable markdownlint for mdx (#6446)
* enable markdownlint for mdx * clean up .markdownlintignore
1 parent 98f254c commit 86a9696

11 files changed

+38
-15
lines changed

.markdownlint.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
"MD002": false,
44
"MD004": { "style": "dash" },
55
"MD007": { "indent": 2 },
6-
"MD013": { "line_length": 600 },
6+
"MD013": { "line_length": 600, "code_blocks": false },
7+
"MD024": {
8+
"siblings_only": true
9+
},
710
"MD026": false,
811
"MD029": { "style": "ordered" },
912
"MD033": false,
1013
"MD034": false,
1114
"MD036": false,
1215
"MD041": false,
16+
"MD053": false,
1317
"no-hard-tabs": false,
1418
"whitespace": false
1519
}

.markdownlintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"lint": "run-s lint:*",
4545
"lint:js": "npm run lint-js .",
4646
"lint-js": "eslint --cache --cache-location .cache/.eslintcache",
47-
"lint:markdown": "npm run lint-markdown *.md",
48-
"lint-markdown": "markdownlint --config ./.markdownlint.json --ignore '.vale/**/*.md' --ignore '.github/**/*.md'",
47+
"lint:markdown": "npm run lint-markdown '**/*.{md,mdx}'",
48+
"lint-markdown": "markdownlint --config ./.markdownlint.json",
4949
"lint:prose": "vale --config='.vale.ini' src/content",
5050
"lint:links": "hyperlink -c 8 --root dist -r dist/index.html --canonicalroot https://webpack.js.org/ --internal --skip /plugins/extract-text-webpack-plugin/ --skip /printable --skip https:// --skip http:// --skip sw.js > internal-links.tap; cat internal-links.tap | tap-spot",
5151
"sitemap": "cd dist && sitemap-static --ignore-file=../sitemap-ignore.json --pretty --prefix=https://webpack.js.org/ > sitemap.xml",
@@ -62,7 +62,7 @@
6262
"*.{js,jsx,md,mdx}": [
6363
"npm run lint-js"
6464
],
65-
"*.md": [
65+
"*.{md,mdx}": [
6666
"npm run lint-markdown"
6767
],
6868
"*.{js,jsx,css,scss,md,mdx,json}": [

src/content/api/loaders.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ module.exports = function (source) {
645645
646646
The module will get bundled like this:
647647
648-
```
648+
```text
649649
/***/ "./src/loader.js!./src/lib.js":
650650
/*!************************************!*\
651651
!*** ./src/loader.js!./src/lib.js ***!
@@ -722,7 +722,10 @@ module.exports = function (source) {
722722
if (STYLES_REGEXP.test(source)) {
723723
source = source.replace(STYLES_REGEXP, '');
724724
return `import ${JSON.stringify(
725-
this.utils.contextify(this.context || this.rootContext, `${this.resource}.css!=!${getStylesLoader}!${this.remainingRequest}`)
725+
this.utils.contextify(
726+
this.context || this.rootContext,
727+
`${this.resource}.css!=!${getStylesLoader}!${this.remainingRequest}`
728+
)
726729
)};${source}`;
727730
}
728731
return source;

src/content/api/module-variables.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Returns the same value as `require.context` but only for `javascript/auto` and `
130130
131131
- Available: 5.70.0+
132132
- Example:
133+
133134
```js
134135
const contextRequire = import.meta.webpackContext('.', {
135136
recursive: false,
@@ -285,6 +286,7 @@ Change base URI at runtime.
285286
- Type: `string`
286287
- Available: 5.21.0+
287288
- Example:
289+
288290
```js
289291
__webpack_base_uri__ = 'https://example.com';
290292
```

src/content/configuration/experiments.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ When enabled, webpack can build remote resources that begin with the `http(s):`
7474
A shortcut for [`experiments.buildHttp.allowedUris`](#experimentsbuildhttpalloweduris).
7575

7676
- `HttpUriOptions`
77+
7778
```ts
7879
{
7980
allowedUris: (string|RegExp|(uri: string) => boolean)[],
@@ -134,6 +135,7 @@ Define the location for caching remote resources.
134135
- `string`
135136
- `false`
136137
- Example
138+
137139
```javascript
138140
// webpack.config.js
139141
module.exports = {
@@ -259,6 +261,7 @@ Compile entrypoints and dynamic `import`s only when they are in use. It can be u
259261

260262
- Available: 5.17.0+
261263
- Example 1:
264+
262265
```js
263266
module.exports = {
264267
//
@@ -267,6 +270,7 @@ Compile entrypoints and dynamic `import`s only when they are in use. It can be u
267270
},
268271
};
269272
```
273+
270274
- Example 2:
271275

272276
```js

src/content/configuration/module.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Enable [magic comments](/api/module-methods/#magic-comments) support for CommonJ
147147
- Type: `boolean`
148148
- Available: 5.17.0+
149149
- Example:
150+
150151
```js
151152
module.exports = {
152153
module: {
@@ -172,6 +173,7 @@ Specifies global mode for dynamic import.
172173
- Type: `'eager' | 'weak' | 'lazy' | 'lazy-once'`
173174
- Available: 5.73.0+
174175
- Example:
176+
175177
```js
176178
module.exports = {
177179
module: {
@@ -191,6 +193,7 @@ Specifies global prefetch for dynamic import.
191193
- Type: ` number | boolean`
192194
- Available: 5.73.0+
193195
- Example:
196+
194197
```js
195198
module.exports = {
196199
module: {
@@ -210,6 +213,7 @@ Specifies global preload for dynamic import.
210213
- Type: ` number | boolean`
211214
- Available: 5.73.0+
212215
- Example:
216+
213217
```js
214218
module.exports = {
215219
module: {
@@ -229,6 +233,7 @@ Specifies the behavior of invalid export names in `\"import ... from ...\"` and
229233
- Type: `'error' | 'warn' | 'auto' | false`
230234
- Available: 5.62.0+
231235
- Example:
236+
232237
```js
233238
module.exports = {
234239
module: {
@@ -248,6 +253,7 @@ Specifies the behavior of invalid export names in `\"import ... from ...\"`.
248253
- Type: `'error' | 'warn' | 'auto' | false`
249254
- Available: 5.62.0+
250255
- Example:
256+
251257
```js
252258
module.exports = {
253259
module: {
@@ -267,6 +273,7 @@ Enable or disable evaluating `import.meta`.
267273
- Type: `boolean = true`
268274
- Available: 5.68.0+
269275
- Example:
276+
270277
```js
271278
module.exports = {
272279
module: {
@@ -286,6 +293,7 @@ Enable/disable evaluating [`import.meta.webpackContext`](/api/module-variables/#
286293
- Type: `boolean`
287294
- Available: 5.70.0+
288295
- Example:
296+
289297
```js
290298
module.exports = {
291299
module: {
@@ -305,6 +313,7 @@ Specifies the behavior of invalid export names in `\"export ... from ...\"`. Thi
305313
- Type: `'error' | 'warn' | 'auto' | false`
306314
- Available: 5.62.0+
307315
- Example:
316+
308317
```js
309318
module.exports = {
310319
module: {
@@ -323,6 +332,7 @@ Enable parsing of `new URL()` syntax.
323332

324333
- Type: `boolean = true` | `'relative'`
325334
- Example:
335+
326336
```js
327337
module.exports = {
328338
module: {
@@ -337,12 +347,12 @@ Enable parsing of `new URL()` syntax.
337347

338348
The `'relative'` value for `module.parser.javascript.url` is available since webpack <Badge text='5.23.0' />. When used, webpack would generate relative URLs for `new URL()` syntax, i.e., there's no base URL included in the result URL:
339349

340-
```
350+
```html
341351
<!-- with 'relative' -->
342-
<img src='c43188443804f1b1f534.svg' />
352+
<img src="c43188443804f1b1f534.svg" />
343353

344354
<!-- without 'relative' -->
345-
<img src='file:///path/to/project/dist/c43188443804f1b1f534.svg' />
355+
<img src="file:///path/to/project/dist/c43188443804f1b1f534.svg" />
346356
```
347357

348358
1. This is useful for SSR (Server side rendering) when base URL is not known by server (and it saves a few bytes). To be identical it must also be used for the client build.

src/content/configuration/output.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ module.exports = {
912912
Specify a name for the library.
913913

914914
- Type:
915+
915916
```ts
916917
string | string[] | {amd?: string, commonjs?: string, root?: string | string[]}
917918
```

src/content/configuration/resolve.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ Configure resolve options by the type of module request.
708708
709709
- Type: `[type: string]: ResolveOptions`
710710
- Example:
711+
711712
```js
712713
module.exports = {
713714
// ...

src/content/configuration/watch.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ Follow symbolic links while looking for a file. This is usually not needed as we
150150

151151
- Type: `boolean`
152152
- Example:
153+
153154
```js
154155
module.exports = {
155156
//...
@@ -165,6 +166,7 @@ Stop watching when stdin stream has ended.
165166

166167
- Type: `boolean`
167168
- Example:
169+
168170
```js
169171
module.exports = {
170172
//...

yarn.lock

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,7 @@
364364
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63"
365365
integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==
366366

367-
"@babel/helper-validator-identifier@^7.18.6":
368-
version "7.18.6"
369-
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076"
370-
integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==
371-
372-
"@babel/helper-validator-identifier@^7.19.1":
367+
"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1":
373368
version "7.19.1"
374369
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2"
375370
integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==

0 commit comments

Comments
 (0)