Skip to content

Commit

Permalink
[repo] Bump mdlint
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Apr 10, 2024
1 parent 0249ebc commit 094a04a
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 96 deletions.
4 changes: 2 additions & 2 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ export default {
'*.css': ['stylelint --allow-empty-input --fix'],
'*.{js,jsx,ts,tsx,mjs}': ['eslint --fix'],
'*.mdx': [
'markdownlint-cli2-config .markdownlint/mdx/fix/.markdownlint-cli2.cjs',
'markdownlint-cli2 --config .markdownlint/mdx/fix/.markdownlint-cli2.cjs',
'cspell --no-must-find-files --no-progress',
],
'*.md': [
'markdownlint-cli2-fix',
'markdownlint-cli2 --fix',
'cspell --no-must-find-files --no-progress',
],
'src/**/*.{js,jsx,ts,tsx,mjs}': [
Expand Down
7 changes: 7 additions & 0 deletions .markdownlint-cli2.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ config.MD033 = {
"var",

// These are custom React elements, either from Docusaurus, or our own.
"AcademyLink",
"CodeBlock",
"ComponentFileSummary",
"Tabs",
"TabItem",
"TabItems",
Expand All @@ -164,9 +166,14 @@ config.MD033 = {
"InvalidExample",
"ReactPlayer",
"Link",
"ProjectSummary",
"ReleaseNoteIntro",
"ReleaseDate",
"ReleaseVersion",
"VersionPHP",
"Lib",
"Lang",
"DbAccessPHP",
]
};

Expand Down
2 changes: 2 additions & 0 deletions docs/apis/plugintypes/assign/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ mod/assign/feedback/file

<!-- markdownlint-capture -->
<!-- markdownlint-disable no-space-in-code -->
<!-- markdownlint-disable no-inline-html -->

export const settingsExample = `
$settings->add(
Expand Down Expand Up @@ -109,6 +110,7 @@ All feedback plugins should include one setting named 'default' to indicate if t

<!-- markdownlint-save -->
<!-- markdownlint-disable code-block-style -->
<!-- markdownlint-disable no-inline-html -->

<LocalLib
required
Expand Down
1 change: 1 addition & 0 deletions docs/apis/plugintypes/assign/submission.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ mod/assign/submission/file
<!-- markdownlint-disable no-space-in-code -->
<!-- markdownlint-disable blanks-around-fences -->
<!-- markdownlint-disable code-block-style -->
<!-- markdownlint-disable no-inline-html -->

import settingsExample from '!!raw-loader!./_files/submission_settings.php';

Expand Down
2 changes: 2 additions & 0 deletions docs/apis/plugintypes/atto/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Some of the important files for the Atto plugintype are described below. See the

### version.php

<!-- markdownlint-disable no-inline-html -->

<VersionPHP
plugintype="atto"
/>
Expand Down
2 changes: 2 additions & 0 deletions docs/apis/plugintypes/repository/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ At this point we have created everything necessary for the administration pages.

That's all - the administration part of our Flickr Public plugin is done. For your information, Box.net, Flickr, and Flickr Public all have similar administration APIs.

<!-- markdownlint-disable no-inline-html -->

import FlickPublicLib from '!!raw-loader!./_examples/flickr_public_lib.php';

<Lib
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"mdlint-all": "markdownlint-cli2 '{docs,general}/**/*.md' '*.md'",
"mdfix": "markdownlint-cli2-fix",
"mdfix-all": "markdownlint-cli2-fix '{docs,general}/**/*.md' '*.md'",
"mdxlint": "markdownlint-cli2-config .markdownlint/mdx/.markdownlint-cli2.cjs",
"mdxlint-all": "markdownlint-cli2-config .markdownlint/mdx/.markdownlint-cli2.cjs '{docs,general}/**/*.mdx' '*.mdx'",
"mdxfix": "markdownlint-cli2-config .markdownlint/mdx/fix/.markdownlint-cli2.cjs",
"mdxfix-all": "markdownlint-cli2-config .markdownlint/mdx/fix/.markdownlint-cli2.cjs '{docs,general}/**/*.mdx' '*.mdx'",
"mdxlint": "markdownlint-cli2 --config .markdownlint/mdx/.markdownlint-cli2.cjs",
"mdxlint-all": "markdownlint-cli2 --config .markdownlint/mdx/.markdownlint-cli2.cjs '{docs,general}/**/*.mdx' '*.mdx'",
"mdxfix": "markdownlint-cli2 --config .markdownlint/mdx/fix/.markdownlint-cli2.cjs",
"mdxfix-all": "markdownlint-cli2 --config .markdownlint/mdx/fix/.markdownlint-cli2.cjs '{docs,general}/**/*.mdx' '*.mdx'",
"migrate": "scripts/wikimedia-fetch.mjs migrate",
"lint": "yarn mdlint-all; yarn mdxlint-all; yarn spell",
"prepare": "husky install",
Expand Down Expand Up @@ -100,7 +100,7 @@
"jest": "^29.3.1",
"js-yaml": "^4.1.0",
"lint-staged": "^13.0.4",
"markdownlint-cli2": "^0.5.1",
"markdownlint-cli2": "^0.13.0",
"markdownlint-rule-helpers": "^0.17.2",
"node-fetch": "^3.3.0",
"nodemw": "^0.18.0",
Expand Down
4 changes: 2 additions & 2 deletions scripts/releases/fetchReleaseNotes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ for file in ${dir}/* ${dir}.md; do
./scripts/releases/stripFullPageName.sh $file
done

yarn markdownlint-cli2-config scripts/migration/phases/12-admonition/.markdownlint-cli2.cjs "${dir}".md
yarn markdownlint-cli2-config scripts/migration/phases/12-admonition/.markdownlint-cli2.cjs "${dir}"/*.md
yarn markdownlint-cli2 --config scripts/migration/phases/12-admonition/.markdownlint-cli2.cjs "${dir}".md
yarn markdownlint-cli2 --config scripts/migration/phases/12-admonition/.markdownlint-cli2.cjs "${dir}"/*.md

yarn mdlint-all

Expand Down
6 changes: 3 additions & 3 deletions scripts/wikimedia-fetch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,15 @@ const fetchOneDoc = async (pageTitle, newPath, options) => {
));
logger.info(`=> Running migration phase ${phaseData.path}`);
if (phaseData.type === 'markdownlint') {
// Use markdownlint-cli2-config to specify these as separate phases.
// Use markdownlint-cli2 to specify these as separate phases.
// This is necessary because if two rules operate on the same text, then no fix is made.
// The order of these is important because they often do operate on the same line.
// For example, we *must* convert all numbered lists before converting markup headers to markdown.
const phaseScript = path.join(phasePath, '.markdownlint-cli2.cjs');
logger.debug(`yarn markdownlint-cli2-config ${phaseScript} ${newFile}`);
logger.debug(`yarn markdownlint-cli2 --config ${phaseScript} ${newFile}`);

await new Promise((resolve) => {
exec(`yarn markdownlint-cli2-config ${phaseScript} ${newFile}`, async (error, stdout, stderr) => {
exec(`yarn markdownlint-cli2 --config ${phaseScript} ${newFile}`, async (error, stdout, stderr) => {
if (error) {
logger.warn(
`The '${phaseData.path}' conversion reported warnings `
Expand Down
Loading

0 comments on commit 094a04a

Please sign in to comment.