diff --git a/js/common/Maintenance.js b/js/common/Maintenance.js index 1bc3a25b..3d0d87ef 100644 --- a/js/common/Maintenance.js +++ b/js/common/Maintenance.js @@ -108,9 +108,9 @@ module.exports = ( function() { static async checkBranchStatus() { const releaseBranches = await ReleaseBranch.getMaintenanceBranches(); - for ( let releaseBranch of releaseBranches ) { + for ( let releaseBranch of releaseBranches ) { // eslint-disable-line no-restricted-syntax console.log( `Checking ${releaseBranch.repo} ${releaseBranch.branch}` ); - for ( let line of await releaseBranch.getStatus() ) { + for ( let line of await releaseBranch.getStatus() ) { // eslint-disable-line no-restricted-syntax console.log( line ); } } @@ -125,7 +125,7 @@ module.exports = ( function() { const failed = []; - for ( let releaseBranch of releaseBranches ) { + for ( let releaseBranch of releaseBranches ) { // eslint-disable-line no-restricted-syntax console.log( `building ${releaseBranch.repo} ${releaseBranch.branch}` ); try { await checkoutTarget( releaseBranch.repo, releaseBranch.branch, true ); // include npm update @@ -155,7 +155,7 @@ module.exports = ( function() { static async list() { const maintenance = Maintenance.load(); - for ( let modifiedBranch of maintenance.modifiedBranches ) { + for ( let modifiedBranch of maintenance.modifiedBranches ) { // eslint-disable-line no-restricted-syntax console.log( `${modifiedBranch.repo} ${modifiedBranch.branch} ${modifiedBranch.brands.join( ',' )}` ); if ( modifiedBranch.deployedVersion ) { console.log( ` deployed: ${modifiedBranch.deployedVersion.toString()}` ); @@ -171,18 +171,18 @@ module.exports = ( function() { } if ( Object.keys( modifiedBranch.changedDependencies ).length > 0 ) { console.log( ' deps:' ); - for ( let key of Object.keys( modifiedBranch.changedDependencies ) ) { + for ( let key of Object.keys( modifiedBranch.changedDependencies ) ) { // eslint-disable-line no-restricted-syntax console.log( ` ${key}: ${modifiedBranch.changedDependencies[ key ]}` ); } } } - for ( let patch of maintenance.patches ) { + for ( let patch of maintenance.patches ) { // eslint-disable-line no-restricted-syntax console.log( `[${patch.repo}] ${patch.message}` ); - for ( let sha of patch.shas ) { + for ( let sha of patch.shas ) { // eslint-disable-line no-restricted-syntax console.log( ` ${sha}` ); } - for ( let modifiedBranch of maintenance.modifiedBranches ) { + for ( let modifiedBranch of maintenance.modifiedBranches ) { // eslint-disable-line no-restricted-syntax if ( modifiedBranch.neededPatches.includes( patch ) ) { console.log( ` ${modifiedBranch.repo} ${modifiedBranch.branch} ${modifiedBranch.brands.join( ',' )}` ); } @@ -200,9 +200,9 @@ module.exports = ( function() { if ( productionBranches.length ) { console.log( '\nProduction links\n' ); - for ( let modifiedBranch of productionBranches ) { + for ( let modifiedBranch of productionBranches ) { // eslint-disable-line no-restricted-syntax const links = await modifiedBranch.getDeployedLinkLines(); - for ( let link of links ) { + for ( let link of links ) { // eslint-disable-line no-restricted-syntax console.log( link ); } } @@ -211,9 +211,9 @@ module.exports = ( function() { if ( releaseCandidateBranches.length ) { console.log( '\nRelease Candidate links\n' ); - for ( let modifiedBranch of releaseCandidateBranches ) { + for ( let modifiedBranch of releaseCandidateBranches ) { // eslint-disable-line no-restricted-syntax const links = await modifiedBranch.getDeployedLinkLines(); - for ( let link of links ) { + for ( let link of links ) { // eslint-disable-line no-restricted-syntax console.log( link ); } } @@ -231,7 +231,7 @@ module.exports = ( function() { static async createPatch( repo, message ) { const maintenance = Maintenance.load(); - for ( let patch of maintenance.patches ) { + for ( let patch of maintenance.patches ) { // eslint-disable-line no-restricted-syntax if ( patch.repo === repo ) { throw new Error( 'Multiple patches with the same repo are not concurrently supported' ); } @@ -256,7 +256,7 @@ module.exports = ( function() { const patch = maintenance.findPatch( repo ); - for ( let branch of maintenance.modifiedBranches ) { + for ( let branch of maintenance.modifiedBranches ) { // eslint-disable-line no-restricted-syntax if ( branch.neededPatches.includes( patch ) ) { throw new Error( 'Patch is marked as needed by at least one branch' ); } @@ -366,7 +366,7 @@ module.exports = ( function() { const patch = maintenance.findPatch( patchRepo ); const releaseBranches = await ReleaseBranch.getMaintenanceBranches(); - for ( let releaseBranch of releaseBranches ) { + for ( let releaseBranch of releaseBranches ) { // eslint-disable-line no-restricted-syntax const needsPatch = await filter( releaseBranch ); if ( !needsPatch ) { @@ -486,7 +486,7 @@ module.exports = ( function() { const patch = maintenance.findPatch( patchRepo ); - for ( let modifiedBranch of maintenance.modifiedBranches ) { + for ( let modifiedBranch of maintenance.modifiedBranches ) { // eslint-disable-line no-restricted-syntax const needsRemoval = await filter( modifiedBranch.releaseBranch ); if ( !needsRemoval ) { @@ -551,7 +551,7 @@ module.exports = ( function() { const maintenance = Maintenance.load(); let numApplied = 0; - for ( let modifiedBranch of maintenance.modifiedBranches ) { + for ( let modifiedBranch of maintenance.modifiedBranches ) { // eslint-disable-line no-restricted-syntax if ( modifiedBranch.neededPatches.length === 0 ) { continue; } @@ -560,7 +560,7 @@ module.exports = ( function() { const branch = modifiedBranch.branch; // Defensive copy, since we modify it during iteration - for ( let patch of modifiedBranch.neededPatches.slice() ) { + for ( let patch of modifiedBranch.neededPatches.slice() ) { // eslint-disable-line no-restricted-syntax if ( patch.shas.length === 0 ) { continue; } @@ -585,7 +585,7 @@ module.exports = ( function() { console.log( `Checked out ${patchRepo} SHA for ${repo} ${branch}` ); - for ( let sha of patch.shas ) { + for ( let sha of patch.shas ) { // eslint-disable-line no-restricted-syntax const cherryPickSuccess = await gitCherryPick( patchRepo, sha ); if ( cherryPickSuccess ) { @@ -625,7 +625,7 @@ module.exports = ( function() { static async updateDependencies() { const maintenance = Maintenance.load(); - for ( let modifiedBranch of maintenance.modifiedBranches ) { + for ( let modifiedBranch of maintenance.modifiedBranches ) { // eslint-disable-line no-restricted-syntax const changedRepos = Object.keys( modifiedBranch.changedDependencies ); if ( changedRepos.length === 0 ) { continue; @@ -635,7 +635,7 @@ module.exports = ( function() { await checkoutTarget( modifiedBranch.repo, modifiedBranch.branch, true ); // npm update, since we'll build. console.log( `Checked out ${modifiedBranch.repo} ${modifiedBranch.branch}` ); - for ( let dependency of changedRepos ) { + for ( let dependency of changedRepos ) { // eslint-disable-line no-restricted-syntax const dependencyBranch = modifiedBranch.dependencyBranch; const branches = await getBranches( dependency ); const sha = modifiedBranch.changedDependencies[ dependency ]; @@ -676,7 +676,7 @@ module.exports = ( function() { await updateDependenciesJSON( modifiedBranch.repo, modifiedBranch.brands, message, modifiedBranch.branch ); // Move messages from pending to pushed - for ( let message of modifiedBranch.pendingMessages ) { + for ( let message of modifiedBranch.pendingMessages ) { // eslint-disable-line no-restricted-syntax if ( !modifiedBranch.pushedMessages.includes( message ) ) { modifiedBranch.pushedMessages.push( message ); } @@ -700,7 +700,7 @@ module.exports = ( function() { static async deployReleaseCandidates() { const maintenance = Maintenance.load(); - for ( let modifiedBranch of maintenance.modifiedBranches ) { + for ( let modifiedBranch of maintenance.modifiedBranches ) { // eslint-disable-line no-restricted-syntax if ( !modifiedBranch.isReadyForReleaseCandidate ) { continue; } @@ -726,7 +726,7 @@ module.exports = ( function() { static async deployProduction() { const maintenance = Maintenance.load(); - for ( let modifiedBranch of maintenance.modifiedBranches ) { + for ( let modifiedBranch of maintenance.modifiedBranches ) { // eslint-disable-line no-restricted-syntax if ( !modifiedBranch.isReadyForProduction ) { continue; } diff --git a/js/common/ModifiedBranch.js b/js/common/ModifiedBranch.js index e481bf87..03d1367d 100644 --- a/js/common/ModifiedBranch.js +++ b/js/common/ModifiedBranch.js @@ -265,7 +265,7 @@ module.exports = ( function() { await gitCheckout( this.repo, this.branch ); await gitPull( this.repo ); const dependencies = await getDependencies( this.repo ); - for ( let key of Object.keys( this.changedDependencies ) ) { + for ( let key of Object.keys( this.changedDependencies ) ) { // eslint-disable-line no-restricted-syntax // This should exist hopefully dependencies[ key ].sha = this.changedDependencies[ key ]; } diff --git a/js/common/ReleaseBranch.js b/js/common/ReleaseBranch.js index 3d2f300a..7cd42947 100644 --- a/js/common/ReleaseBranch.js +++ b/js/common/ReleaseBranch.js @@ -191,7 +191,7 @@ module.exports = ( function() { results.push( 'Own repository not included in dependencies' ); } - for ( let dependency of dependencyNames ) { + for ( let dependency of dependencyNames ) { // eslint-disable-line no-restricted-syntax const potentialReleaseBranch = `${this.repo}-${this.branch}`; const branches = await getBranches( dependency ); @@ -255,9 +255,9 @@ module.exports = ( function() { static combineLists( simBranches ) { const resultBranches = []; - for ( let simBranch of simBranches ) { + for ( let simBranch of simBranches ) { // eslint-disable-line no-restricted-syntax let foundBranch = false; - for ( let resultBranch of resultBranches ) { + for ( let resultBranch of resultBranches ) { // eslint-disable-line no-restricted-syntax if ( simBranch.repo === resultBranch.repo && simBranch.branch === resultBranch.branch ) { foundBranch = true; resultBranch.brands = [ ...resultBranch.brands, ...simBranch.brands ]; diff --git a/js/common/checkoutMaster.js b/js/common/checkoutMaster.js index 1c3ee0cd..9bebfdcd 100644 --- a/js/common/checkoutMaster.js +++ b/js/common/checkoutMaster.js @@ -30,7 +30,7 @@ module.exports = async function( repo, includeNpmUpdate ) { // Ignore the comment const repoNames = Object.keys( dependencies ).filter( key => key !== 'comment' ); - for ( let repoName of repoNames ) { + for ( let repoName of repoNames ) { // eslint-disable-line no-restricted-syntax await gitCheckout( repoName, 'master' ); } diff --git a/js/common/checkoutTimestamp.js b/js/common/checkoutTimestamp.js index eaabe8f8..b86e5751 100644 --- a/js/common/checkoutTimestamp.js +++ b/js/common/checkoutTimestamp.js @@ -32,7 +32,7 @@ module.exports = async function( repo, timestamp, includeNpmUpdate ) { const dependencies = await getDependencies( repo ); const dependencyNames = Object.keys( dependencies ).filter( key => key !== 'comment' && key !== repo ); const timestampDependencies = {}; - for ( let dependency of dependencyNames ) { + for ( let dependency of dependencyNames ) { // eslint-disable-line no-restricted-syntax timestampDependencies[ dependency ] = { sha: await gitFromTimestamp( dependency, 'master', timestamp ) }; diff --git a/js/common/updateGithubPages.js b/js/common/updateGithubPages.js index 00f65621..d0a90317 100644 --- a/js/common/updateGithubPages.js +++ b/js/common/updateGithubPages.js @@ -44,7 +44,7 @@ module.exports = async function() { { repo: 'scenery', build: true } ]; - for ( let taggedRepo of taggedRepos ) { + for ( let taggedRepo of taggedRepos ) { // eslint-disable-line no-restricted-syntax const repo = taggedRepo.repo; winston.info( `Updating ${repo}` ); diff --git a/js/common/writePhetioHtaccess.js b/js/common/writePhetioHtaccess.js index 466c7946..8b19e9ec 100644 --- a/js/common/writePhetioHtaccess.js +++ b/js/common/writePhetioHtaccess.js @@ -32,7 +32,7 @@ module.exports = async function writePhetioHtaccess( passwordProtectPath, latest let latestRedirectContents = 'RewriteEngine on\n' + `RewriteBase /sims/${latestOption.simName}/\n`; const versions = JSON.parse( await request( buildLocal.productionServerURL + `/services/metadata/phetio?name=${latestOption.simName}&latest=true` ) ); - for ( let v of versions ) { + for ( let v of versions ) { // eslint-disable-line no-restricted-syntax // Add a trailing slash to /sims/sim-name/x.y latestRedirectContents += `RewriteRule ${v.versionMajor}.${v.versionMinor}$ ${v.versionMajor}.${v.versionMinor}/ [R=301,L]\n`; // Rewrite /sims/sim-name/x.y/* to /sims/sim-name/x.y.z/* diff --git a/js/grunt/checkoutShas.js b/js/grunt/checkoutShas.js index a2f00b43..2f48a91d 100644 --- a/js/grunt/checkoutShas.js +++ b/js/grunt/checkoutShas.js @@ -30,7 +30,7 @@ module.exports = function( repositoryName, toMaster, buildServer ) { } } - for ( let property of dependencies ) { + for ( let property of dependencies ) { // eslint-disable-line no-restricted-syntax if ( property !== 'comment' && property !== repositoryName && dependencies.hasOwnProperty( property ) ) { assert( typeof( dependencies[ property ].branch !== 'undefined' ) && typeof( dependencies[ property ].sha !== 'undefined' ) ); diff --git a/js/grunt/dev.js b/js/grunt/dev.js index 54ba7417..07f387bf 100644 --- a/js/grunt/dev.js +++ b/js/grunt/dev.js @@ -134,7 +134,7 @@ module.exports = async function( repo, brands, noninteractive, branch, message ) await devSsh( `mkdir -p "${versionPath}"` ); // Copy the build contents into the version-specific directory - for ( let brand of brands ) { + for ( let brand of brands ) { // eslint-disable-line no-restricted-syntax await devScp( `../${repo}/build/${brand}`, `${versionPath}/` ); } diff --git a/js/grunt/generateData.js b/js/grunt/generateData.js index d733e29a..1e2974a7 100644 --- a/js/grunt/generateData.js +++ b/js/grunt/generateData.js @@ -45,7 +45,7 @@ module.exports = async function() { const activeRepos = getActiveRepos(); - for ( let repo of activeRepos ) { + for ( let repo of activeRepos ) { // eslint-disable-line no-restricted-syntax await gitPull( repo ); }