Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tools/lint-readme-lists.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import assert from 'node:assert';
import { open } from 'node:fs/promises';
import { argv } from 'node:process';

const ghHandleLine = /^\* \[(.+)\]\(https:\/\/github\.com\/\1\) -$/;
const ghHandleLine = /^\* \[(.+)\]\(https:\/\/github\.com\/(.+)\) -$/;
const memberInfoLine = /^ {2}\*\*[^*]+\*\* <<[^@]+@.+\.[a-z]+>>( \(\w+(\/[^)/]+)+\))?( - \[Support me\]\(.+\))?$/;

const lists = {
Expand Down Expand Up @@ -59,9 +59,11 @@ for await (const line of readme.readLines()) {
);
}

if (!ghHandleLine.test(line)) {
throw new Error(`${currentGithubHandle} is not formatted correctly (README.md:${lineNumber})`);
const match = line.match(ghHandleLine);
if (!match) {
throw new Error(`${line} should match ${ghHandleLine} (README.md:${lineNumber})`);
}
assert.strictEqual(match[1], match[2], `GitHub handle does not match the URL (README.md:${lineNumber})`);

if (
currentList === 'TSC voting members' ||
Expand Down
Loading