From c29bf4974a003a8d2f11dccf703667455cd92397 Mon Sep 17 00:00:00 2001 From: Leo McArdle Date: Mon, 31 Jul 2023 15:58:09 +0000 Subject: [PATCH 1/3] fix(lint-staged): markdownlint and prettier can race on md files followed the markdownlint/prettier ordering defined in the package.json fix:md and lint:md commands see: https://github.com/okonet/lint-staged#task-concurrency follow-up to: https://github.com/mdn/content/pull/27936 --- .lintstagedrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index eed2c4850059c76..cb8ef897f018f9c 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,7 +1,8 @@ { - "*": "prettier --ignore-unknown --write", + "!*.md": "prettier --ignore-unknown --write", "*.md": [ "markdownlint-cli2-fix", + "prettier --write", "node scripts/front-matter_linter.js --fix true" ], "tests/**/*.*": "yarn test:front-matter-linter", From 835ae8e38d8958615705e5dc2da9c76cf82cf414 Mon Sep 17 00:00:00 2001 From: Leo McArdle Date: Tue, 1 Aug 2023 11:26:28 +0100 Subject: [PATCH 2/3] Update .lintstagedrc.json Co-authored-by: Onkar Ruikar <87750369+OnkarRuikar@users.noreply.github.com> --- .lintstagedrc.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index cb8ef897f018f9c..9e259f12baf57f8 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,9 +1,9 @@ { "!*.md": "prettier --ignore-unknown --write", "*.md": [ - "markdownlint-cli2-fix", - "prettier --write", - "node scripts/front-matter_linter.js --fix true" + "markdownlint-cli2 --fix", + "node scripts/front-matter_linter.js --fix true", + "prettier --write" ], "tests/**/*.*": "yarn test:front-matter-linter", "*.{svg,png,jpeg,jpg,gif}": "yarn filecheck" From 64d963e9ef9a3d36a6dc46f364cdf247f68f4d4a Mon Sep 17 00:00:00 2001 From: Leo McArdle Date: Tue, 1 Aug 2023 10:33:54 +0000 Subject: [PATCH 3/3] use in package.json as well --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 26db84953c84d0b..20c87e5ab836eb5 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "fix:fm": "node scripts/front-matter_linter.js --fix true", "fix:js": "prettier -w \"**/*.(m)?js\"", "fix:json": "prettier -w \"**/*.json(c)?\"", - "fix:md": "markdownlint-cli2-fix \"**/*.md\" && prettier -w \"**/*.md\"", + "fix:md": "markdownlint-cli2 --fix \"**/*.md\" && prettier -w \"**/*.md\"", "fix:yml": "prettier -w \"**/*.yml\"", "lint:fm": "node scripts/front-matter_linter.js", "lint:js": "prettier -c \"**/*.(m)?js\"",