Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ For information about the governance of the Node.js project, see
**Filip Skokan** <<panva.ip@gmail.com>> (he/him)
* [pimterry](https://github.com/pimterry) -
**Tim Perry** <<pimterry@gmail.com>> (he/him)
* [pmarchini](https://github.com/pmarchini)
* [pmarchini](https://github.com/pmarchini) -
**Pietro Marchini** <<pietro.marchini94@gmail.com>> (he/him)
* [Qard](https://github.com/Qard) -
**Stephen Belanger** <<admin@stephenbelanger.com>> (he/him)
Expand Down Expand Up @@ -515,7 +515,7 @@ For information about the governance of the Node.js project, see
**Hitesh Kanwathirtha** <<digitalinfinity@gmail.com>> (he/him)
* [dmabupt](https://github.com/dmabupt) -
**Xu Meng** <<dmabupt@gmail.com>> (he/him)
* [dnlup](https://github.com/dnlup)
* [dnlup](https://github.com/dnlup) -
**dnlup** <<dnlup.dev@gmail.com>>
* [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) -
**Robert Jefe Lindstaedt** <<robert.lindstaedt@gmail.com>>
Expand Down Expand Up @@ -757,7 +757,7 @@ maintaining the Node.js project.
**Mert Can Altin** <<mertgold60@gmail.com>>
* [preveen-stack](https://github.com/preveen-stack) -
**Preveen Padmanabhan** <<wide4head@gmail.com>> (he/him)
* [RedYetiDev](https://github.com/redyetidev) -
* [RedYetiDev](https://github.com/RedYetiDev) -
**Aviv Keller** <<redyetidev@gmail.com>> (they/them)
* [VoltrexKeyva](https://github.com/VoltrexKeyva) -
**Mohammed Keyvanzadeh** <<mohammadkeyvanzade94@gmail.com>> (he/him)
Expand Down
18 changes: 16 additions & 2 deletions tools/lint-readme-lists.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import assert from 'node:assert';
import { open } from 'node:fs/promises';
import { argv } from 'node:process';

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

const lists = {
'__proto__': null,

Expand All @@ -26,12 +29,19 @@ const tscMembers = new Set();
const readme = await open(new URL('../README.md', import.meta.url), 'r');

let currentList = null;
let previousGithubHandleInfoRequired;
let previousGithubHandle;
let lineNumber = 0;

for await (const line of readme.readLines()) {
lineNumber++;
if (line.startsWith('### ')) {
if (previousGithubHandleInfoRequired) {
if (!memberInfoLine.test(line)) {
throw new Error(`${previousGithubHandleInfoRequired} info are not formatted correctly (README.md:${lineNumber})`);
}
previousGithubHandle = previousGithubHandleInfoRequired;
previousGithubHandleInfoRequired = null;
} else if (line.startsWith('### ')) {
currentList = line.slice(4);
previousGithubHandle = null;
} else if (line.startsWith('#### ')) {
Expand All @@ -49,6 +59,10 @@ for await (const line of readme.readLines()) {
);
}

if (!ghHandleLine.test(line)) {
throw new Error(`${currentGithubHandle} is not formatted correctly (README.md:${lineNumber})`);
}

if (
currentList === 'TSC voting members' ||
currentList === 'TSC regular members'
Expand All @@ -60,7 +74,7 @@ for await (const line of readme.readLines()) {
if (lists[currentList]) {
(actualMembers[lists[currentList]] ??= new Set()).add(currentGithubHandle);
}
previousGithubHandle = currentGithubHandleLowerCase;
previousGithubHandleInfoRequired = currentGithubHandleLowerCase;
}
}
console.info('Lists are in the alphabetical order.');
Expand Down
Loading