async function readdirRecursive(rootDir, ignore = []) {
	const files = [];
	const noDotFiles = ignore.includes('.');
	const noDeclarationFiles = ignore.includes('.d.ts');
	const r = async dir => {
		const p = [];
		const wdir = join(rootDir, dir);
		for (const f of await fs.readdir(wdir, { withFileTypes: true })) {
			const name = join(dir, f.name);
			if (
				(noDotFiles && f.name[0] === '.') ||
				(noDeclarationFiles && /\.d\.ts$/.test(f.name)) ||
				ignore.includes(f.name) ||
				ignore.includes('/' + name)
			)
				continue;
			if (f.isFile()) files.push(name);
			else if (f.isDirectory()) p.push(r(name));
		}
		if (p.length) await Promise.all(p);
	};
	await r('');
	return files;
}
@param {string} rootDir directory in which to search
@param {string[]} [ignore = []] Root-relative paths start with `/`, no slash ignores by file basename, `"."` ignores all dotfiles