-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override markdownlint-cli2 config for zh-cn (#14246)
* Override markdownlint-cli2 config for zh-cn * Add zh-tw style angled quotes * use same globs as the content repo * Address review comments * Update deprecated use * Apply suggestions from code review Co-authored-by: A1lo <[email protected]> --------- Co-authored-by: A1lo <[email protected]>
- Loading branch information
1 parent
a56e5a7
commit 49d6818
Showing
3 changed files
with
163 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"config": { | ||
"extends": "../../.markdownlint-cli2.jsonc", | ||
"search-replace": { | ||
"rules": [ | ||
{ | ||
"name": "nbsp", | ||
"message": "Don't use no-break spaces", | ||
"searchPattern": "/ /g", | ||
"replace": " ", | ||
"searchScope": "all" | ||
}, | ||
// XXX Many instances still found in translated content | ||
// { | ||
// "name": "m-dash", | ||
// "message": "Don't use '--'. Use m-dash — instead", | ||
// "search": " -- ", | ||
// "replace": "——", | ||
// "searchScope": "text" | ||
// }, | ||
// { | ||
// "name": "relative-link", | ||
// "message": "Internal links should start with '/'", | ||
// "searchPattern": "/([\\(\"])(en-US|zh-CN)\\/docs/gi", | ||
// "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" | ||
// } | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"config": { | ||
"extends": "../../.markdownlint-cli2.jsonc", | ||
"search-replace": { | ||
"rules": [ | ||
// XXX Many instances still found in translated content | ||
// { | ||
// "name": "curly-double-quotes", | ||
// "message": "Don't use curly double quotes", | ||
// "searchPattern": "/“(.*?)”/gm", | ||
// "replace": "「$1」", | ||
// "searchScope": "text" | ||
// }, | ||
// { | ||
// "name": "double-quotes", | ||
// "message": "Don't use double quotes", | ||
// "searchPattern": "/‘(.*?)’/g", | ||
// "replace": "『$1』", | ||
// "searchScope": "text" | ||
// }, | ||
{ | ||
"name": "nbsp", | ||
"message": "Don't use no-break spaces", | ||
"searchPattern": "/ /g", | ||
"replace": " ", | ||
"searchScope": "all" | ||
}, | ||
// XXX Many instances still found in translated content | ||
// { | ||
// "name": "m-dash", | ||
// "message": "Don't use '--'. Use m-dash — instead", | ||
// "search": " -- ", | ||
// "replace": "——", | ||
// "searchScope": "text" | ||
// }, | ||
// { | ||
// "name": "relative-link", | ||
// "message": "Internal links should start with '/'", | ||
// "searchPattern": "/([\\(\"])(en-US|zh-TW)\\/docs/gi", | ||
// "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" | ||
// } | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters