/** * @fileoverview Script to update the README with team and sponsors. * Note that this requires eslint/website to be available in the same * directory as the eslint repo. * * node tools/update-readme.js * * @author Nicholas C. Zakas */ "use strict"; //----------------------------------------------------------------------------- // Requirements //----------------------------------------------------------------------------- const path = require("path"); const fs = require("fs"); const { stripIndents } = require("common-tags"); const ejs = require("ejs"); //----------------------------------------------------------------------------- // Data //----------------------------------------------------------------------------- const README_FILE_PATH = path.resolve(__dirname, "../README.md"); const WEBSITE_DATA_PATH = path.resolve(__dirname, "../../website/_data"); const team = JSON.parse(fs.readFileSync(path.join(WEBSITE_DATA_PATH, "team.json"))); const allSponsors = JSON.parse(fs.readFileSync(path.join(WEBSITE_DATA_PATH, "sponsors.json"))); const readme = fs.readFileSync(README_FILE_PATH, "utf8"); const heights = { gold: 96, silver: 64, bronze: 32 }; // remove backers from sponsors list - not shown on readme delete allSponsors.backers; //----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- /** * Formats an array of team members for inclusion in the readme. * @param {Array} members The array of members to format. * @returns {string} The HTML for the members list. */ function formatTeamMembers(members) { /* eslint-disable indent*/ return stripIndents`
![]() ${member.name} | ${(index + 1) % 9 === 0 ? "