chore: use markdownlint-cli2 directly for linting Markdown (#608)

This commit is contained in:
David Sanders 2024-08-01 14:09:40 -07:00 коммит произвёл GitHub
Родитель 8d3248b1c8
Коммит f6192d5156
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
12 изменённых файлов: 117 добавлений и 55 удалений

19
.markdownlint-cli2.cjs Normal file
Просмотреть файл

@ -0,0 +1,19 @@
const fs = require('node:fs');
const os = require('node:os');
module.exports = {
config: {
extends: '@electron/lint-roller/configs/markdownlint.json',
'link-image-style': {
autolink: false,
shortcut: true,
},
'no-angle-brackets': true,
'no-curly-braces': true,
'no-alt-text': false,
'no-newline-in-links': true,
'no-shortcut-reference-links': false,
},
customRules: ['@electron/lint-roller/markdownlint-rules/'],
ignores: fs.readFileSync('.markdownlintignore', 'utf-8').trim().split(os.EOL),
};

Просмотреть файл

@ -1,8 +0,0 @@
{
"extends": "@electron/lint-roller/configs/markdownlint.json",
"link-image-style": {
"shortcut": true
},
"no-alt-text": false,
"no-shortcut-reference-links": false
}

Просмотреть файл

@ -1,2 +1,3 @@
create-electron-documentation/templates/documentation.md
docs/**
node_modules/**

Просмотреть файл

@ -134,8 +134,8 @@ What have we been doing to develop our community presence?
- In 2020, we participated in the initial iteration of Google Season of Docs, where we worked with
[@bandantonio](https://github.com/bandantonio) to rework Electrons new user tutorial flow.
- In 2022, we mentored a Google Summer of Code student for the first time.
[@aryanshridhar](https://github.com/aryanshridhar) did some awesome work to refactor [Electron
Fiddle](https://github.com/electron/fiddle)'s core version loading logic and migrate its bundler
[@aryanshridhar](https://github.com/aryanshridhar) did some awesome work to refactor
[Electron Fiddle](https://github.com/electron/fiddle)'s core version loading logic and migrate its bundler
to [webpack](https://webpack.js.org/).
### Automate all the things!

Просмотреть файл

@ -43,8 +43,8 @@ You can read more about the [new UtilityProcess API in our docs here](https://ww
**2023/02/16: An update on Windows Server 2012 support**
Last month, Google announced that [Chrome 109 would continue to receive critical
security fixes](https://support.google.com/chrome/a/thread/185534987) for
Last month, Google announced that
[Chrome 109 would continue to receive critical security fixes](https://support.google.com/chrome/a/thread/185534987) for
Windows Server 2012 and Windows Server 2012 R2 until October 10, 2023.
In accordance, Electron 22's (Chromium 108) planned end of life date will be extended from May 30, 2023 to October 10, 2023. The Electron team will continue to backport any security fixes that are part of this program to Electron 22 until October 10, 2023.
@ -124,8 +124,8 @@ The `new-window` event of WebContents has been removed. It is replaced by [`webC
#### Deprecated: BrowserWindow `scroll-touch-*` events
The `scroll-touch-begin`, `scroll-touch-end` and `scroll-touch-edge` events on
BrowserWindow are deprecated. Instead, use the newly available [`input-event`
event](https://electronjs.org/docs/latest/api/web-contents#event-input-event) on WebContents.
BrowserWindow are deprecated. Instead, use the newly available
[`input-event` event](https://electronjs.org/docs/latest/api/web-contents#event-input-event) on WebContents.
```diff
// Deprecated

Просмотреть файл

@ -77,8 +77,7 @@ libchromiumcontent soon exceeded the limitation.
The solution was to filter out unneeded symbols when generating the DLL file.
It worked by [providing a `.def` file to the linker][libcc-def], and then using
a script to [judge whether symbols under a namespace should be
exported][libcc-filter].
a script to [judge whether symbols under a namespace should be exported][libcc-filter].
By taking this approach, though Chromium kept adding new exported symbols,
libchromiumcontent could still generate shared library files by stripping more
@ -147,9 +146,8 @@ so the intermediate static library files are no longer generated.
This improvement however made great trouble to libchromiumcontent, because
the intermediate static library files were actually needed by libchromiumcontent.
The first try to solve this was to [patch `gn` to generate static library
files][libcc-gn-hack], which solved the problem, but was far from a decent
solution.
The first try to solve this was to [patch `gn` to generate static library files][libcc-gn-hack],
which solved the problem, but was far from a decent solution.
The second try was made by [@alespergl](https://github.com/alespergl) to
[produce custom static libraries from the list of object files][libcc-gn].

Просмотреть файл

@ -84,8 +84,8 @@ hidden when building Node as a library and native modules will fail to load
because they cannot find the symbols.
So in order to make native modules work, the V8 and libuv symbols
were exposed in Electron. For V8 this is done by [forcing all
symbols in Chromium's configuration file to be exposed][v8-expose]. For libuv,
were exposed in Electron. For V8 this is done by
[forcing all symbols in Chromium's configuration file to be exposed][v8-expose]. For libuv,
it is achieved by [setting the `BUILDING_UV_SHARED=1` definition][libuv-expose].
## Starting Node in your app

Просмотреть файл

@ -24,8 +24,8 @@ with GitHub, opening and updating pull requests automatically as content is tran
Though we've been working quietly on this effort so far,
over 75 Electron community members have already discovered the project
organically and joined in the effort to internationalize the website and
translate Electron's docs into over 20 languages. We are seeing [daily
contributions](https://github.com/electron/electron-i18n/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aglotbot%20) from people all over the world, with translations for
translate Electron's docs into over 20 languages. We are seeing
[daily contributions](https://github.com/electron/electron-i18n/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aglotbot%20) from people all over the world, with translations for
languages like French, Vietnamese, Indonesian, and Chinese leading the way.
To choose your language and view translation progress, visit [electronjs.org/languages](https://electronjs.org/languages)

Просмотреть файл

@ -71,8 +71,7 @@ As you type into this input, the URL of the page is updated dynamically. This
allows you to copy a URL representing a particular slice of userland data,
then share it with others.
[![babel](https://cloud.githubusercontent.com/assets/2289/21328807/7bfa75e4-c5ea-11e6-8212-0e7988b367fd.png)
](https://electronjs.org/userland/dev_dependencies?q=babel%20preset)
[![babel](https://cloud.githubusercontent.com/assets/2289/21328807/7bfa75e4-c5ea-11e6-8212-0e7988b367fd.png)](https://electronjs.org/userland/dev_dependencies?q=babel%20preset)
## More to come

Просмотреть файл

@ -42,8 +42,8 @@ What this means for developers:
**2023/02/16: An update on Windows Server 2012 support**
Last month, Google announced that [Chrome 109 would continue to receive critical
security fixes](https://support.google.com/chrome/a/thread/185534987) for
Last month, Google announced that
[Chrome 109 would continue to receive critical security fixes](https://support.google.com/chrome/a/thread/185534987) for
Windows Server 2012 and Windows Server 2012 R2 until October 10, 2023.
In accordance, Electron 22's (Chromium 108) planned end of life date will be extended from May 30, 2023 to October 10, 2023. The Electron team will continue to backport any security fixes that are part of this program to Electron 22 until October 10, 2023.

Просмотреть файл

@ -23,7 +23,7 @@
"write-heading-ids": "docusaurus write-heading-ids",
"update-l10n-sources": "npx tsx scripts/update-l10n-sources.ts",
"lint:eslint": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \"scripts/**/*.{js,ts}\"",
"lint:markdown": "electron-markdownlint \"**/*.md\"",
"lint:markdown": "markdownlint-cli2 \"**/*.md\"",
"lint": "npx tsc --noEmit && prettier . --check && npm run lint:eslint && npm run lint:markdown",
"lint:fix": "prettier . --write && npm run lint:eslint --fix && npm run lint:markdown --fix",
"pre-build": "npx tsx ./scripts/pre-build.ts",
@ -55,7 +55,7 @@
"@docusaurus/tsconfig": "3.4.0",
"@docusaurus/types": "3.4.0",
"@electron/docs-parser": "^1.0.1",
"@electron/lint-roller": "^2.2.0",
"@electron/lint-roller": "^2.3.0",
"@tsconfig/docusaurus": "^2.0.3",
"@types/fs-extra": "^9.0.13",
"@types/mdast": "^4.0.4",
@ -84,6 +84,7 @@
"json5": "^2.2.2",
"latest-version": "^5.1.0",
"lint-staged": "^13.2.0",
"markdownlint-cli2": "^0.13.0",
"mdast-util-frontmatter": "^2.0.1",
"mdast-util-to-string": "^2.0.0",
"patch-package": "^8.0.0",

104
yarn.lock
Просмотреть файл

@ -1905,14 +1905,16 @@
ora "^4.0.3"
pretty-ms "^5.1.0"
"@electron/lint-roller@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@electron/lint-roller/-/lint-roller-2.2.0.tgz#3390ea37868b1ac35863cd393ddf776d049a2e3c"
integrity sha512-gYOwL7p3vXJjzndzW0ewnYuBz+WcNOGCbqNBJLmoVwimHGdNJ7cdh9/AwAggcjHEPO/zpRMfpfhUM7shNPagCQ==
"@electron/lint-roller@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@electron/lint-roller/-/lint-roller-2.3.0.tgz#4b7702f7275020e75ecda87869c7bfe7ae9aa12c"
integrity sha512-sENX/utPp6lhN2OWH4VcIP+zpjgM/sTX0fnaB36hTnWTSRs7JX7qGNS9jZK9jsgGup1UjPFUr5L9zawk5ivHkw==
dependencies:
"@dsanders11/vscode-markdown-languageservice" "^0.3.0"
ajv "^8.16.0"
balanced-match "^2.0.0"
glob "^8.1.0"
hast-util-from-html "^2.0.1"
markdown-it "^13.0.1"
markdownlint-cli "^0.40.0"
mdast-util-from-markdown "^1.3.0"
@ -1923,6 +1925,7 @@
vscode-languageserver "^8.1.0"
vscode-languageserver-textdocument "^1.0.8"
vscode-uri "^3.0.7"
yaml "^2.4.5"
"@esbuild/aix-ppc64@0.20.2":
version "0.20.2"
@ -3276,6 +3279,16 @@ ajv@^8.0.0, ajv@^8.8.0:
require-from-string "^2.0.2"
uri-js "^4.2.2"
ajv@^8.16.0:
version "8.17.1"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6"
integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==
dependencies:
fast-deep-equal "^3.1.3"
fast-uri "^3.0.1"
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"
ajv@^8.9.0:
version "8.13.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.13.0.tgz#a3939eaec9fb80d217ddf0c3376948c023f28c91"
@ -6337,6 +6350,11 @@ fast-levenshtein@^2.0.6:
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==
fast-uri@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.1.tgz#cddd2eecfc83a71c1be2cc2ef2061331be8a7134"
integrity sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==
fast-url-parser@1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d"
@ -6903,6 +6921,18 @@ globals@^13.19.0:
dependencies:
type-fest "^0.20.2"
globby@14.0.1, globby@^14.0.1:
version "14.0.1"
resolved "https://registry.yarnpkg.com/globby/-/globby-14.0.1.tgz#a1b44841aa7f4c6d8af2bc39951109d77301959b"
integrity sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==
dependencies:
"@sindresorhus/merge-streams" "^2.1.0"
fast-glob "^3.3.2"
ignore "^5.2.4"
path-type "^5.0.0"
slash "^5.1.0"
unicorn-magic "^0.1.0"
globby@^11.0.1, globby@^11.0.3, globby@^11.0.4, globby@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
@ -6926,18 +6956,6 @@ globby@^13.1.1:
merge2 "^1.4.1"
slash "^4.0.0"
globby@^14.0.1:
version "14.0.1"
resolved "https://registry.yarnpkg.com/globby/-/globby-14.0.1.tgz#a1b44841aa7f4c6d8af2bc39951109d77301959b"
integrity sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==
dependencies:
"@sindresorhus/merge-streams" "^2.1.0"
fast-glob "^3.3.2"
ignore "^5.2.4"
path-type "^5.0.0"
slash "^5.1.0"
unicorn-magic "^0.1.0"
gopd@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c"
@ -7151,6 +7169,18 @@ hasown@^2.0.0:
dependencies:
function-bind "^1.1.2"
hast-util-from-html@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz#9cd38ee81bf40b2607368b92a04b0905fa987488"
integrity sha512-RXQBLMl9kjKVNkJTIO6bZyb2n+cUH8LFaSSzo82jiLT6Tfc+Pt7VQCS+/h3YwG4jaNE2TA2sdJisGWR+aJrp0g==
dependencies:
"@types/hast" "^3.0.0"
devlop "^1.1.0"
hast-util-from-parse5 "^8.0.0"
parse5 "^7.0.0"
vfile "^6.0.0"
vfile-message "^4.0.0"
hast-util-from-parse5@^8.0.0:
version "8.0.1"
resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz#654a5676a41211e14ee80d1b1758c399a0327651"
@ -8112,6 +8142,13 @@ js-sdsl@^4.1.4:
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
js-yaml@4.1.0, js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"
js-yaml@^3.13.1:
version "3.14.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
@ -8120,13 +8157,6 @@ js-yaml@^3.13.1:
argparse "^1.0.7"
esprima "^4.0.0"
js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"
jsesc@^2.5.1:
version "2.5.2"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
@ -8199,7 +8229,7 @@ json5@^2.2.2:
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab"
integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ==
jsonc-parser@~3.2.1:
jsonc-parser@3.2.1, jsonc-parser@~3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a"
integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==
@ -8645,6 +8675,23 @@ markdown-table@^3.0.0:
resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-3.0.3.tgz#e6331d30e493127e031dd385488b5bd326e4a6bd"
integrity sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==
markdownlint-cli2-formatter-default@0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/markdownlint-cli2-formatter-default/-/markdownlint-cli2-formatter-default-0.0.4.tgz#81e26b0a50409c0357c6f0d38d8246946b236fab"
integrity sha512-xm2rM0E+sWgjpPn1EesPXx5hIyrN2ddUnUwnbCsD/ONxYtw3PX6LydvdH6dciWAoFDpwzbHM1TO7uHfcMd6IYg==
markdownlint-cli2@^0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/markdownlint-cli2/-/markdownlint-cli2-0.13.0.tgz#691cab01994295b4b8c87aa0485c0b1e0f792289"
integrity sha512-Pg4nF7HlopU97ZXtrcVISWp3bdsuc5M0zXyLp2/sJv2zEMlInrau0ZKK482fQURzVezJzWBpNmu4u6vGAhij+g==
dependencies:
globby "14.0.1"
js-yaml "4.1.0"
jsonc-parser "3.2.1"
markdownlint "0.34.0"
markdownlint-cli2-formatter-default "0.0.4"
micromatch "4.0.5"
markdownlint-cli@^0.40.0:
version "0.40.0"
resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.40.0.tgz#57678cabd543c654d2ea88f752e9ac058b31c207"
@ -8667,7 +8714,7 @@ markdownlint-micromark@0.1.9:
resolved "https://registry.yarnpkg.com/markdownlint-micromark/-/markdownlint-micromark-0.1.9.tgz#4876996b60d4dceb3a02f4eee2d3a366eb9569fa"
integrity sha512-5hVs/DzAFa8XqYosbEAEg6ok6MF2smDj89ztn9pKkCtdKHVdPQuGMH7frFfYL9mLkvfFe4pTyAMffLbjf3/EyA==
markdownlint@~0.34.0:
markdownlint@0.34.0, markdownlint@~0.34.0:
version "0.34.0"
resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.34.0.tgz#bbc2047c952d1644269009a69ba227ed597b23fa"
integrity sha512-qwGyuyKwjkEMOJ10XN6OTKNOVYvOIi35RNvDLNxTof5s8UmyGHlCdpngRHoRGNvQVGuxO3BJ7uNSgdeX166WXw==
@ -9584,7 +9631,7 @@ micromark@^4.0.0:
micromark-util-symbol "^2.0.0"
micromark-util-types "^2.0.0"
micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5:
micromatch@4.0.5, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
@ -13615,6 +13662,11 @@ yaml@^2.2.2:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.5.tgz#60630b206dd6d84df97003d33fc1ddf6296cca5e"
integrity sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==
yaml@^2.4.5:
version "2.5.0"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.0.tgz#c6165a721cf8000e91c36490a41d7be25176cf5d"
integrity sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==
yauzl@^2.4.2:
version "2.10.0"
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"