Skip to content
Snippets Groups Projects
Unverified Commit 13d2ced6 authored by Onkar Ruikar's avatar Onkar Ruikar Committed by GitHub
Browse files

fix(ci): Reuse markdownlint config files for 'files' and 'docs' hiera… (#15106)

* fix(ci): Reuse markdownlint config files for 'files' and 'docs' hierarchies

* Fix a Prettier  issue
parent 8fe72319
Branches
No related tags found
No related merge requests found
// This file defines our configuration for Markdownlint. See
// https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
// for more details on each rule.
{ {
"config": { "config": {
"default": true, "extends": "./.markdownlint.jsonc"
// Disabled, as some callouts include headings.
"header-increment": false,
"ul-style": {
"style": "dash"
},
"ul-indent": {
"indent": 2
},
"no-hard-tabs": {
"spaces_per_tab": 2
},
"line-length": false,
"no-duplicate-header": false,
// XXX Replace with the following when ready:
// "no-duplicate-header": {
// "allow_different_nesting": true
// },
"single-title": {
"front_matter_title": "^\\s*title\\s*[:=]"
},
"no-trailing-punctuation": {
"punctuation": ".,;:"
},
// Consecutive Notes/Callouts currently don't conform with this rule
"no-blanks-blockquote": false,
// Force ordered numbering to catch accidental list ending from indenting
"ol-prefix": {
"style": "ordered"
},
"no-inline-html": {
"allowed_elements": [
"a",
"abbr",
"annotation",
"br",
"caption",
"code",
"col",
"colgroup",
"dd",
"details",
"div",
"dl",
"dt",
"em",
"h4",
"h5",
"img",
"kbd",
"li",
"math",
"menclose",
"mfenced",
"mfrac",
"mfrac",
"mi",
"mmultiscripts",
"mn",
"mo",
"mover",
"mphantom",
"mprescripts",
"mroot",
"mrow",
"ms",
"mspace",
"mspace",
"msqrt",
"mstyle",
"msub",
"msubsup",
"msup",
"mtable",
"mtd",
"mtext",
"mtr",
"munder",
"munderover",
"none",
"ol",
"p",
"pre",
"q",
"section",
"semantics",
"strong",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"tr",
"ul",
"var",
"dfn", // XXX Still used in some translated content
"ruby", // Used in some Korean documents
"rp", // Used in some Korean documents
"rt", // Used in some Korean documents
"i", // French translations use this for English literal text
"h2", // XXX Not always converted currently because of live samples using English IDs
"h3", // XXX Not always converted currently because of live samples using English IDs
"h6" // XXX Not always converted currently because of live samples using English IDs
]
},
"no-bare-urls": false,
// XXX Fixed upstream, remove next line when fixed here
"no-emphasis-as-header": false,
// Produces too many false positives
"no-space-in-emphasis": false,
"fenced-code-language": false,
// See https://github.com/mdn/content/pull/20026, as macros currently break this
"no-empty-links": false,
// XXX Fixed upstream, remove next line when fixed here
"no-alt-text": false,
"code-block-style": {
"style": "fenced"
},
"emphasis-style": false,
// XXX Replace with the following when ready:
// "emphasis-style": {
// "style": "underscore"
// },
"strong-style": {
"style": "asterisk"
},
// Disabled, as yari generates link fragments by replacing spaces with underscores, not dashes.
"link-fragments": false,
// XXX Fixed upstream, remove next line when fixed here
"reference-links-images": false,
// https://github.com/OnkarRuikar/markdownlint-rule-search-replace
"search-replace": {
"rules": [
// XXX Many instances still found in translated content
// {
// // Does not apply to zh-cn
// "name": "curly-double-quotes",
// "message": "Don't use curly double quotes",
// "searchPattern": "/“|”/g",
// "replace": "\"",
// "searchScope": "text"
// },
// {
// // Does not apply to zh-cn
// "name": "curly-single-quotes",
// "message": "Don't use curly single quotes",
// "searchPattern": "/‘|’/g",
// "replace": "'",
// "searchScope": "text"
// },
{
"name": "nbsp",
"message": "Don't use no-break spaces",
"searchPattern": "/ /g",
"replace": " ",
"searchScope": "all"
},
{
// zh-cn/zh-tw prefers double em-dash instead
"name": "em-dash",
"message": "Don't use '--'. Use em-dash (—) instead",
"search": " -- ",
"replace": " — ",
"searchScope": "text"
},
{
"name": "relative-link",
"message": "Internal links should start with '/'",
"searchPattern": "/([\\(\"])([\\w\\-]+)\\/docs/g",
"replace": "$1/$2/docs",
"searchScope": "text"
},
{
"name": "relative-link-path",
"message": "Don't use relative paths",
"search": "](..",
"searchScope": "text"
},
{
"name": "trailing-spaces",
"message": "Avoid trailing spaces",
"searchPattern": "/ +$/gm",
"replace": "",
"searchScope": "all"
},
{
"name": "double-spaces",
"message": "Avoid double spaces",
"searchPattern": "/([^\\s>]) ([^\\s|])/g",
"replace": "$1 $2",
"searchScope": "text"
},
{
"name": "stuck-definition",
"message": "Character is stuck to definition description marker",
"searchPattern": "/- :(\\w)/g",
"replace": "- : $1",
"searchScope": "text"
},
{
"name": "fqdn-moz-links",
"message": "Don't use developer.mozilla.org for links, except for blog posts",
"searchPattern": "/\\]\\(https:\\/\\/developer.mozilla.org\\/(?!en-US\\/blog\\/)/g",
"replace": "](/",
"searchScope": "text"
}
// XXX Many instances still found in translated content
// {
// "name": "localhost-links",
// "message": "Don't use localhost for links",
// "searchPattern": "/\\]\\(https?:\\/\\/localhost:\\d+\\//g",
// "replace": "](/",
// "searchScope": "text"
// }
]
}
}, },
"customRules": ["markdownlint-rule-search-replace"], "customRules": ["markdownlint-rule-search-replace"],
"ignores": [ "ignores": [
......
// This file defines our configuration for Markdownlint. See
// https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
// for more details on each rule.
{
"default": true,
// Disabled, as some callouts include headings.
"header-increment": false,
"ul-style": {
"style": "dash"
},
"ul-indent": {
"indent": 2
},
"no-hard-tabs": {
"spaces_per_tab": 2
},
"line-length": false,
"no-duplicate-header": false,
// XXX Replace with the following when ready:
// "no-duplicate-header": {
// "allow_different_nesting": true
// },
"single-title": {
"front_matter_title": "^\\s*title\\s*[:=]"
},
"no-trailing-punctuation": {
"punctuation": ".,;:"
},
// Consecutive Notes/Callouts currently don't conform with this rule
"no-blanks-blockquote": false,
// Force ordered numbering to catch accidental list ending from indenting
"ol-prefix": {
"style": "ordered"
},
"no-inline-html": {
"allowed_elements": [
"a",
"abbr",
"annotation",
"br",
"caption",
"code",
"col",
"colgroup",
"dd",
"details",
"div",
"dl",
"dt",
"em",
"h4",
"h5",
"img",
"kbd",
"li",
"math",
"menclose",
"mfenced",
"mfrac",
"mfrac",
"mi",
"mmultiscripts",
"mn",
"mo",
"mover",
"mphantom",
"mprescripts",
"mroot",
"mrow",
"ms",
"mspace",
"mspace",
"msqrt",
"mstyle",
"msub",
"msubsup",
"msup",
"mtable",
"mtd",
"mtext",
"mtr",
"munder",
"munderover",
"none",
"ol",
"p",
"pre",
"q",
"section",
"semantics",
"strong",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"tr",
"ul",
"var",
"dfn", // XXX Still used in some translated content
"ruby", // Used in some Korean documents
"rp", // Used in some Korean documents
"rt", // Used in some Korean documents
"i", // French translations use this for English literal text
"h2", // XXX Not always converted currently because of live samples using English IDs
"h3", // XXX Not always converted currently because of live samples using English IDs
"h6" // XXX Not always converted currently because of live samples using English IDs
]
},
"no-bare-urls": false,
// XXX Fixed upstream, remove next line when fixed here
"no-emphasis-as-header": false,
// Produces too many false positives
"no-space-in-emphasis": false,
"fenced-code-language": false,
// See https://github.com/mdn/content/pull/20026, as macros currently break this
"no-empty-links": false,
// XXX Fixed upstream, remove next line when fixed here
"no-alt-text": false,
"code-block-style": {
"style": "fenced"
},
"emphasis-style": false,
// XXX Replace with the following when ready:
// "emphasis-style": {
// "style": "underscore"
// },
"strong-style": {
"style": "asterisk"
},
// Disabled, as yari generates link fragments by replacing spaces with underscores, not dashes.
"link-fragments": false,
// XXX Fixed upstream, remove next line when fixed here
"reference-links-images": false,
// https://github.com/OnkarRuikar/markdownlint-rule-search-replace
"search-replace": {
"rules": [
// XXX Many instances still found in translated content
// {
// // Does not apply to zh-cn
// "name": "curly-double-quotes",
// "message": "Don't use curly double quotes",
// "searchPattern": "/“|”/g",
// "replace": "\"",
// "searchScope": "text"
// },
// {
// // Does not apply to zh-cn
// "name": "curly-single-quotes",
// "message": "Don't use curly single quotes",
// "searchPattern": "/‘|’/g",
// "replace": "'",
// "searchScope": "text"
// },
{
"name": "nbsp",
"message": "Don't use no-break spaces",
"searchPattern": "/ /g",
"replace": " ",
"searchScope": "all"
},
{
// zh-cn/zh-tw prefers double em-dash instead
"name": "em-dash",
"message": "Don't use '--'. Use em-dash (—) instead",
"search": " -- ",
"replace": " — ",
"searchScope": "text"
},
{
"name": "relative-link",
"message": "Internal links should start with '/'",
"searchPattern": "/([\\(\"])([\\w\\-]+)\\/docs/g",
"replace": "$1/$2/docs",
"searchScope": "text"
},
{
"name": "relative-link-path",
"message": "Don't use relative paths",
"search": "](..",
"searchScope": "text"
},
{
"name": "trailing-spaces",
"message": "Avoid trailing spaces",
"searchPattern": "/ +$/gm",
"replace": "",
"searchScope": "all"
},
{
"name": "double-spaces",
"message": "Avoid double spaces",
"searchPattern": "/([^\\s>]) ([^\\s|])/g",
"replace": "$1 $2",
"searchScope": "text"
},
{
"name": "stuck-definition",
"message": "Character is stuck to definition description marker",
"searchPattern": "/- :(\\w)/g",
"replace": "- : $1",
"searchScope": "text"
},
{
"name": "fqdn-moz-links",
"message": "Don't use developer.mozilla.org for links, except for blog posts",
"searchPattern": "/\\]\\(https:\\/\\/developer.mozilla.org\\/(?!en-US\\/blog\\/)/g",
"replace": "](/",
"searchScope": "text"
}
// XXX Many instances still found in translated content
// {
// "name": "localhost-links",
// "message": "Don't use localhost for links",
// "searchPattern": "/\\]\\(https?:\\/\\/localhost:\\d+\\//g",
// "replace": "](/",
// "searchScope": "text"
// }
]
}
}
{
"extends": "../../files/zh-cn/.markdownlint.jsonc"
}
{
"extends": "../../files/zh-tw/.markdownlint.jsonc"
}
...@@ -63,6 +63,7 @@ l10n: ...@@ -63,6 +63,7 @@ l10n:
- {{domxref('Element/pointerenter_event', 'pointerenter')}} - {{domxref('Element/pointerenter_event', 'pointerenter')}}
- : 포인터가 요소 또는 요소 자손의 적중 테스트 경계 내로 들어오면 발생합니다. 호버를 지원하지 않는 장치(`pointerdown`을 참고하세요)에서의 `pointerdown` 이벤트 결과로도 발생합니다. `pointerover`와 유사하지만 이 이벤트는 버블링하지 않습니다. - : 포인터가 요소 또는 요소 자손의 적중 테스트 경계 내로 들어오면 발생합니다. 호버를 지원하지 않는 장치(`pointerdown`을 참고하세요)에서의 `pointerdown` 이벤트 결과로도 발생합니다. `pointerover`와 유사하지만 이 이벤트는 버블링하지 않습니다.
- {{domxref('Element/pointerdown_event', 'pointerdown')}} - {{domxref('Element/pointerdown_event', 'pointerdown')}}
- : 포인터가 "활성" 상태가 되면 발생합니다. 마우스에 있어서 활성은 장치의 버튼이 아무것도 눌리지 않은 상태에서 적어도 한 개의 버튼이 눌린 상태로 전환될 때입니다. 터치에서는 디지타이저와 물리적 접촉을 할 때고, 펜에서는 스타일러스가 디지타이저와 물리적 접촉을 할 때입니다. - : 포인터가 "활성" 상태가 되면 발생합니다. 마우스에 있어서 활성은 장치의 버튼이 아무것도 눌리지 않은 상태에서 적어도 한 개의 버튼이 눌린 상태로 전환될 때입니다. 터치에서는 디지타이저와 물리적 접촉을 할 때고, 펜에서는 스타일러스가 디지타이저와 물리적 접촉을 할 때입니다.
> **참고:** [직접 조작](https://w3c.github.io/pointerevents/#dfn-direct-manipulation)을 지원하는 터치 화면 브라우저에서는 `pointerdown` 이벤트가 [암시적인 포인터 포획](https://w3c.github.io/pointerevents/#dfn-implicit-pointer-capture)을 유발하여 이후 발생하는 모든 포인터 이벤트가 대상에게 포획됩니다. 포획된 이벤트들은 포획 대상의 위에서 발생하는 것처럼 취급합니다. 따라서 포획 중에는 `pointerover`, `pointerenter`, `pointerleave`, `pointerout`이 **발생하지 않습니다**. 포인터 포획은 대상 요소의 {{domxref('element.releasePointerCapture')}}를 직접 호출해서 해제할 수도 있고, `pointerup`이나 `pointercancel` 이벤트가 발생하면 암시적으로 해제됩니다. > **참고:** [직접 조작](https://w3c.github.io/pointerevents/#dfn-direct-manipulation)을 지원하는 터치 화면 브라우저에서는 `pointerdown` 이벤트가 [암시적인 포인터 포획](https://w3c.github.io/pointerevents/#dfn-implicit-pointer-capture)을 유발하여 이후 발생하는 모든 포인터 이벤트가 대상에게 포획됩니다. 포획된 이벤트들은 포획 대상의 위에서 발생하는 것처럼 취급합니다. 따라서 포획 중에는 `pointerover`, `pointerenter`, `pointerleave`, `pointerout`이 **발생하지 않습니다**. 포인터 포획은 대상 요소의 {{domxref('element.releasePointerCapture')}}를 직접 호출해서 해제할 수도 있고, `pointerup`이나 `pointercancel` 이벤트가 발생하면 암시적으로 해제됩니다.
......
{
"config": {
"extends": "../../.markdownlint-cli2.jsonc",
"search-replace": {
"rules": [
{
"name": "nbsp",
"message": "Don't use no-break spaces",
"searchPattern": "/ /g",
"replace": " ",
"searchScope": "all"
},
{
"name": "double-em-dash",
"message": "Don't use '--'. Use double em-dash (——) instead",
"search": " -- ",
"replace": "——",
"searchScope": "text"
},
{
"name": "relative-link",
"message": "Internal links should start with '/'",
"searchPattern": "/([\\(\"])([\\w\\-]+)\\/docs/g",
"replace": "$1/$2/docs",
"searchScope": "text"
},
{
"name": "relative-link-path",
"message": "Don't use relative paths",
"search": "](..",
"searchScope": "text"
},
{
"name": "trailing-spaces",
"message": "Avoid trailing spaces",
"searchPattern": "/ +$/gm",
"replace": "",
"searchScope": "all"
},
{
"name": "double-spaces",
"message": "Avoid double spaces",
"searchPattern": "/([^\\s>]) ([^\\s|])/g",
"replace": "$1 $2",
"searchScope": "text"
},
{
"name": "stuck-definition",
"message": "Character is stuck to definition description marker",
"searchPattern": "/- :(\\w)/g",
"replace": "- : $1",
"searchScope": "text"
},
{
"name": "fqdn-moz-links",
"message": "Don't use developer.mozilla.org for links, except for blog posts",
"searchPattern": "/\\]\\(https:\\/\\/developer.mozilla.org\\/(?!en-US\\/blog\\/)/g",
"replace": "](/",
"searchScope": "text"
}
// XXX Many instances still found in translated content
// {
// "name": "localhost-links",
// "message": "Don't use localhost for links",
// "searchPattern": "/\\]\\(https?:\\/\\/localhost:\\d+\\//g",
// "replace": "](/",
// "searchScope": "text"
// }
]
}
}
}
{
"extends": "../../.markdownlint.jsonc",
"search-replace": {
"rules": [
{
"name": "nbsp",
"message": "Don't use no-break spaces",
"searchPattern": "/ /g",
"replace": " ",
"searchScope": "all"
},
{
"name": "double-em-dash",
"message": "Don't use '--'. Use double em-dash (——) instead",
"search": " -- ",
"replace": "——",
"searchScope": "text"
},
{
"name": "relative-link",
"message": "Internal links should start with '/'",
"searchPattern": "/([\\(\"])([\\w\\-]+)\\/docs/g",
"replace": "$1/$2/docs",
"searchScope": "text"
},
{
"name": "relative-link-path",
"message": "Don't use relative paths",
"search": "](..",
"searchScope": "text"
},
{
"name": "trailing-spaces",
"message": "Avoid trailing spaces",
"searchPattern": "/ +$/gm",
"replace": "",
"searchScope": "all"
},
{
"name": "double-spaces",
"message": "Avoid double spaces",
"searchPattern": "/([^\\s>]) ([^\\s|])/g",
"replace": "$1 $2",
"searchScope": "text"
},
{
"name": "stuck-definition",
"message": "Character is stuck to definition description marker",
"searchPattern": "/- :(\\w)/g",
"replace": "- : $1",
"searchScope": "text"
},
{
"name": "fqdn-moz-links",
"message": "Don't use developer.mozilla.org for links, except for blog posts",
"searchPattern": "/\\]\\(https:\\/\\/developer.mozilla.org\\/(?!en-US\\/blog\\/)/g",
"replace": "](/",
"searchScope": "text"
}
// XXX Many instances still found in translated content
// {
// "name": "localhost-links",
// "message": "Don't use localhost for links",
// "searchPattern": "/\\]\\(https?:\\/\\/localhost:\\d+\\//g",
// "replace": "](/",
// "searchScope": "text"
// }
]
}
}
{
"config": {
"extends": "../../.markdownlint-cli2.jsonc",
"search-replace": {
"rules": [
{
"name": "curly-double-quotes-open",
"message": "Don't use curly double quotes",
"searchPattern": "/“/g",
"replace": "「",
"searchScope": "text"
},
{
"name": "curly-double-quotes-close",
"message": "Don't use curly double quotes",
"searchPattern": "/”/g",
"replace": "」",
"searchScope": "text"
},
{
"name": "curly-single-quotes-open",
"message": "Don't use curly single quotes",
"searchPattern": "/‘/g",
"replace": "『",
"searchScope": "text"
},
{
"name": "curly-single-quotes-close",
"message": "Don't use curly single quotes",
"searchPattern": "/’/g",
"replace": "』",
"searchScope": "text"
},
{
"name": "nbsp",
"message": "Don't use no-break spaces",
"searchPattern": "/ /g",
"replace": " ",
"searchScope": "all"
},
{
"name": "double-em-dash",
"message": "Don't use '--'. Use double em-dash (——) instead",
"search": " -- ",
"replace": "——",
"searchScope": "text"
},
{
"name": "relative-link",
"message": "Internal links should start with '/'",
"searchPattern": "/([\\(\"])([\\w\\-]+)\\/docs/g",
"replace": "$1/$2/docs",
"searchScope": "text"
},
{
"name": "relative-link-path",
"message": "Don't use relative paths",
"search": "](..",
"searchScope": "text"
},
{
"name": "trailing-spaces",
"message": "Avoid trailing spaces",
"searchPattern": "/ +$/gm",
"replace": "",
"searchScope": "all"
},
{
"name": "double-spaces",
"message": "Avoid double spaces",
"searchPattern": "/([^\\s>]) ([^\\s|])/g",
"replace": "$1 $2",
"searchScope": "text"
},
{
"name": "stuck-definition",
"message": "Character is stuck to definition description marker",
"searchPattern": "/- :(\\w)/g",
"replace": "- : $1",
"searchScope": "text"
},
{
"name": "fqdn-moz-links",
"message": "Don't use developer.mozilla.org for links, except for blog posts",
"searchPattern": "/\\]\\(https:\\/\\/developer.mozilla.org\\/(?!en-US\\/blog\\/)/g",
"replace": "](/",
"searchScope": "text"
}
// XXX Many instances still found in translated content
// {
// "name": "localhost-links",
// "message": "Don't use localhost for links",
// "searchPattern": "/\\]\\(https?:\\/\\/localhost:\\d+\\//g",
// "replace": "](/",
// "searchScope": "text"
// }
]
}
}
}
{
"extends": "../../.markdownlint.jsonc",
"search-replace": {
"rules": [
{
"name": "curly-double-quotes-open",
"message": "Don't use curly double quotes",
"searchPattern": "/“/g",
"replace": "「",
"searchScope": "text"
},
{
"name": "curly-double-quotes-close",
"message": "Don't use curly double quotes",
"searchPattern": "/”/g",
"replace": "」",
"searchScope": "text"
},
{
"name": "curly-single-quotes-open",
"message": "Don't use curly single quotes",
"searchPattern": "/‘/g",
"replace": "『",
"searchScope": "text"
},
{
"name": "curly-single-quotes-close",
"message": "Don't use curly single quotes",
"searchPattern": "/’/g",
"replace": "』",
"searchScope": "text"
},
{
"name": "nbsp",
"message": "Don't use no-break spaces",
"searchPattern": "/ /g",
"replace": " ",
"searchScope": "all"
},
{
"name": "double-em-dash",
"message": "Don't use '--'. Use double em-dash (——) instead",
"search": " -- ",
"replace": "——",
"searchScope": "text"
},
{
"name": "relative-link",
"message": "Internal links should start with '/'",
"searchPattern": "/([\\(\"])([\\w\\-]+)\\/docs/g",
"replace": "$1/$2/docs",
"searchScope": "text"
},
{
"name": "relative-link-path",
"message": "Don't use relative paths",
"search": "](..",
"searchScope": "text"
},
{
"name": "trailing-spaces",
"message": "Avoid trailing spaces",
"searchPattern": "/ +$/gm",
"replace": "",
"searchScope": "all"
},
{
"name": "double-spaces",
"message": "Avoid double spaces",
"searchPattern": "/([^\\s>]) ([^\\s|])/g",
"replace": "$1 $2",
"searchScope": "text"
},
{
"name": "stuck-definition",
"message": "Character is stuck to definition description marker",
"searchPattern": "/- :(\\w)/g",
"replace": "- : $1",
"searchScope": "text"
},
{
"name": "fqdn-moz-links",
"message": "Don't use developer.mozilla.org for links, except for blog posts",
"searchPattern": "/\\]\\(https:\\/\\/developer.mozilla.org\\/(?!en-US\\/blog\\/)/g",
"replace": "](/",
"searchScope": "text"
}
// XXX Many instances still found in translated content
// {
// "name": "localhost-links",
// "message": "Don't use localhost for links",
// "searchPattern": "/\\]\\(https?:\\/\\/localhost:\\d+\\//g",
// "replace": "](/",
// "searchScope": "text"
// }
]
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment