From 34ba31afb364fef73d963d6d139ec3e5c2eb4867 Mon Sep 17 00:00:00 2001 From: Steven Presti Date: Fri, 27 Oct 2023 13:18:05 -0400 Subject: [PATCH] eslint: remove linting warnings/errors --- dist/index.js | 14 +++++++------- package.json | 1 + src/actionItems.ts | 6 +++--- src/createIssue.ts | 2 +- src/meetingTopics.ts | 6 +++--- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9a73ec5..d7b747d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -22832,16 +22832,16 @@ async function GetActionItems() { const meetingNotesURL = core.getInput('rootURLMeetingLogs'); let lastMeetingNotesUrl = `fedora_coreos_meeting.`; const listOfMeetings = await fetchData(meetingNotesURL); - let matches = listOfMeetings.match(meetingListRegEx); + const matches = listOfMeetings.match(meetingListRegEx); if (matches != null) { const lastMeeting = matches[matches.length - 1]; // This should be the latest meeting`s date in with the format of YYYY-MM-DD-HH.MM.txt lastMeetingNotesUrl = meetingNotesURL + lastMeetingNotesUrl + lastMeeting; - console.debug('last meeting notes url' + lastMeetingNotesUrl); + console.debug(`last meeting notes url${lastMeetingNotesUrl}`); const lastMeetingNotes = await fetchData(lastMeetingNotesUrl); const actionItemMatches = actionItemsRegEx.exec(lastMeetingNotes); if (actionItemMatches) { - console.debug('action item matches' + actionItemMatches[0]); + console.debug(`action item matches${actionItemMatches[0]}`); // if the match is just new lines, then there were no action items if (actionItemMatches[0].match(/^\s*$/)) { return `#topic there are no action items from the last meeting.`; @@ -22908,7 +22908,7 @@ async function createThisReposIssue(body) { }); // calculate todays date in YYYY-MM-DD format const today = new Date().toISOString().split('T')[0]; - var title = core.getInput('issueTitle') + ' ' + today; + const title = `${core.getInput('issueTitle')} ${today}`; const githubRepository = process.env.GITHUB_REPOSITORY; if (!githubRepository) { throw new Error(`GITHUB_REPOSITORY environment variable is not set`); @@ -23054,9 +23054,9 @@ async function GetMeetingTopics() { return `#topic No meeting topics found.`; } let issuesToBeDiscussed = ``; - for (let i = 0; i < issues.data.length; i++) { - issuesToBeDiscussed += ` - [ ] \`#topic ${issues.data[i].title}\` \n`; - issuesToBeDiscussed += ` - \`#link ${issues.data[i].html_url}\` \n`; + for (var i of issues.data) { + issuesToBeDiscussed += ` - [ ] \`#topic ${i.title}\` \n`; + issuesToBeDiscussed += ` - \`#link ${i.html_url}\` \n`; } return issuesToBeDiscussed; } diff --git a/package.json b/package.json index ef7ed73..6846ad6 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "format:write": "prettier --write **/*.ts", "format:check": "prettier --check **/*.ts", "lint": "npx eslint . -c ./.github/linters/.eslintrc.yml", + "lint:fix": "npx eslint . -c ./.github/linters/.eslintrc.yml --fix", "package": "ncc build src/index.ts --license licenses.txt", "package:watch": "npm run package -- --watch", "test": "(jest && make-coverage-badge --output-path ./badges/coverage.svg) || make-coverage-badge --output-path ./badges/coverage.svg", diff --git a/src/actionItems.ts b/src/actionItems.ts index 9ab48fa..d1bbe22 100644 --- a/src/actionItems.ts +++ b/src/actionItems.ts @@ -14,18 +14,18 @@ export async function GetActionItems(): Promise { const meetingNotesURL = core.getInput('rootURLMeetingLogs') let lastMeetingNotesUrl = `fedora_coreos_meeting.` const listOfMeetings = await fetchData(meetingNotesURL) - let matches = listOfMeetings.match(meetingListRegEx) + const matches = listOfMeetings.match(meetingListRegEx) if (matches != null) { const lastMeeting = matches[matches.length - 1] // This should be the latest meeting`s date in with the format of YYYY-MM-DD-HH.MM.txt lastMeetingNotesUrl = meetingNotesURL + lastMeetingNotesUrl + lastMeeting - console.debug('last meeting notes url' + lastMeetingNotesUrl) + console.debug(`last meeting notes url${lastMeetingNotesUrl}`) const lastMeetingNotes = await fetchData(lastMeetingNotesUrl) const actionItemMatches = actionItemsRegEx.exec(lastMeetingNotes) if (actionItemMatches) { - console.debug('action item matches' + actionItemMatches[0]) + console.debug(`action item matches${actionItemMatches[0]}`) // if the match is just new lines, then there were no action items if (actionItemMatches[0].match(/^\s*$/)) { return `#topic there are no action items from the last meeting.` diff --git a/src/createIssue.ts b/src/createIssue.ts index 37f4891..f66add6 100644 --- a/src/createIssue.ts +++ b/src/createIssue.ts @@ -8,7 +8,7 @@ export async function createThisReposIssue(body: string): Promise { }) // calculate todays date in YYYY-MM-DD format const today = new Date().toISOString().split('T')[0] - var title = core.getInput('issueTitle') + ' ' + today + const title = `${core.getInput('issueTitle')} ${today}` const githubRepository = process.env.GITHUB_REPOSITORY if (!githubRepository) { throw new Error(`GITHUB_REPOSITORY environment variable is not set`) diff --git a/src/meetingTopics.ts b/src/meetingTopics.ts index cedd9d9..1ec6f4d 100644 --- a/src/meetingTopics.ts +++ b/src/meetingTopics.ts @@ -18,9 +18,9 @@ export async function GetMeetingTopics(): Promise { } let issuesToBeDiscussed = `` - for (let i = 0; i < issues.data.length; i++) { - issuesToBeDiscussed += ` - [ ] \`#topic ${issues.data[i].title}\` \n` - issuesToBeDiscussed += ` - \`#link ${issues.data[i].html_url}\` \n` + for (var i of issues.data) { + issuesToBeDiscussed += ` - [ ] \`#topic ${i.title}\` \n` + issuesToBeDiscussed += ` - \`#link ${i.html_url}\` \n` } return issuesToBeDiscussed } catch (error) {