Skip to content

Commit 5a7067d

Browse files
committed
style: more manual lint error fixes
1 parent 8b38ffa commit 5a7067d

File tree

6 files changed

+185
-184
lines changed

6 files changed

+185
-184
lines changed

.github/scripts/check-gs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ async function checkProject(
167167
);
168168

169169
try {
170-
await execAsync(`tsc -p "${projectTempDir}"`, { cwd: rootDir });
170+
await execAsync(`tsc -p \"${projectTempDir}\"`, { cwd: rootDir });
171171
return { name: project.name, success: true, output: "" };
172-
} catch (e: any) {
172+
} catch (e: { stdout: string; stderr: string }) {
173173
const rawOutput = (e.stdout || "") + (e.stderr || "");
174174

175175
const rewritten = rawOutput

solutions/automations/offsite-activity-signup/Code.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ function assignWithRandomPriority_(
116116
}, {});
117117
for (let i = 0; i < numActivitiesPerPerson; ++i) {
118118
const randomizedAttendees = shuffleArray_(attendees);
119-
randomizedAttendees.forEach((attendee) => {
119+
for (const attendee of randomizedAttendees) {
120120
makeChoice_(attendee, activitiesById);
121-
});
121+
}
122122
}
123123
}
124124

@@ -201,7 +201,6 @@ function writeAttendeeAssignments_(ss, attendees) {
201201
function writeActivityRosters_(ss, activities) {
202202
const sheet = findOrCreateSheetByName_(ss, "Activity rosters");
203203
sheet.clear();
204-
const rows = [];
205204
let rows = activities.map((activity) => {
206205
const roster = activity.roster.map((attendee) => attendee.email);
207206
return [activity.description].concat(roster);
@@ -330,9 +329,9 @@ function generateTestData_() {
330329

331330
const activities = loadActivitySchedule_(ss);
332331
const choices = fillArray_([], activities.length, "");
333-
range_(1, 5).forEach((value) => {
332+
for (const value of range_(1, 5)) {
334333
choices[value] = toOrdinal_(value);
335-
});
334+
}
336335

337336
const rows = range_(1, NUM_TEST_USERS).map((value) => {
338337
const randomizedChoices = shuffleArray_(choices);
@@ -457,7 +456,8 @@ function range_(start, end) {
457456
const arr = [start];
458457
let i = start;
459458
while (i < end) {
460-
arr.push((i += 1));
459+
i += 1;
460+
arr.push(i);
461461
}
462462
return arr;
463463
}
@@ -473,12 +473,12 @@ function range_(start, end) {
473473
*/
474474
function transpose_(arr, fillValue) {
475475
const transposed = [];
476-
arr.forEach((row, rowIndex) => {
477-
row.forEach((col, colIndex) => {
476+
for (const [rowIndex, row] of arr.entries()) {
477+
for (const [colIndex, col] of row.entries()) {
478478
transposed[colIndex] =
479479
transposed[colIndex] || fillArray_([], arr.length, fillValue);
480480
transposed[colIndex][rowIndex] = row[colIndex];
481-
});
482-
});
481+
}
482+
}
483483
return transposed;
484484
}

solutions/automations/upload-files/Code.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ function onFormSubmit(e) {
7575

7676
// Moves the files to the destination folder.
7777
if (fileUploads.length > 0) {
78-
fileUploads.forEach((fileId) => {
78+
for (const fileId of fileUploads) {
7979
DriveApp.getFileById(fileId).moveTo(destFolder);
8080
console.log(`File Copied: ${fileId}`);
81-
});
81+
}
8282
}
8383
} catch (err) {
8484
console.log(err);

solutions/automations/youtube-tracker/Code.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function markVideos() {
3737
const sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
3838

3939
// Runs through process for each tab in Spreadsheet.
40-
sheets.forEach((dataSheet) => {
40+
for (const dataSheet of sheets) {
4141
const tabName = dataSheet.getName();
4242
const range = dataSheet.getDataRange();
4343
const numRows = range.getNumRows();
@@ -96,7 +96,7 @@ function markVideos() {
9696
if (emailContent.length > 0 && EMAIL_ON === "Y") {
9797
sendEmailNotificationTemplate(emailContent, tabName);
9898
}
99-
});
99+
}
100100
}
101101

102102
/**

solutions/editor-add-on/clean-sheet/Code.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ function deleteEmptyRows() {
8484
console.log(rangesToDelete);
8585

8686
// Deletes the rows using REVERSE order to ensure proper indexing is used.
87-
rangesToDelete
88-
.reverse()
89-
.forEach(([start, end]) => sheet.deleteRows(start, end - start + 1));
87+
for (const [start, end] of rangesToDelete.reverse()) {
88+
sheet.deleteRows(start, end - start + 1);
89+
}
9090
SpreadsheetApp.flush();
9191
}
9292

@@ -159,9 +159,9 @@ function deleteEmptyColumns() {
159159
console.log(rangesToDelete);
160160

161161
// Deletes the columns using REVERSE order to ensure proper indexing is used.
162-
rangesToDelete
163-
.reverse()
164-
.forEach(([start, end]) => sheet.deleteColumns(start, end - start + 1));
162+
for (const [start, end] of rangesToDelete.reverse()) {
163+
sheet.deleteColumns(start, end - start + 1);
164+
}
165165
SpreadsheetApp.flush();
166166
}
167167

0 commit comments

Comments
 (0)