From 30eb87682cbd38b6e5d7691c686b72297bceddb8 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Sun, 11 Apr 2021 09:27:06 -0500 Subject: [PATCH] lint(prettier): trailingComma preferred as all vs none Co-authored-by: Steven --- .prettierrc.json | 2 +- src/index.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.prettierrc.json b/.prettierrc.json index a2f723bf..1e336995 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -4,7 +4,7 @@ "useTabs": false, "semi": true, "singleQuote": true, - "trailingComma": "none", + "trailingComma": "all", "bracketSpacing": true, "arrowParens": "avoid", "parser": "typescript" diff --git a/src/index.ts b/src/index.ts index 783f5eba..84248799 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,7 +15,7 @@ async function main() { sha, ref, repo: { owner, repo }, - payload + payload, } = github.context; const { GITHUB_RUN_ID } = process.env; @@ -40,7 +40,7 @@ async function main() { const { data: current_run } = await octokit.actions.getWorkflowRun({ owner, repo, - run_id: Number(GITHUB_RUN_ID) + run_id: Number(GITHUB_RUN_ID), }); if (workflow_id) { @@ -64,12 +64,12 @@ async function main() { repo, // @ts-ignore workflow_id, - branch + branch, }); const branchWorkflows = data.workflow_runs.filter(run => run.head_branch === branch); console.log( - `Found ${branchWorkflows.length} runs for workflow ${workflow_id} on branch ${branch}` + `Found ${branchWorkflows.length} runs for workflow ${workflow_id} on branch ${branch}`, ); console.log(branchWorkflows.map(run => `- ${run.html_url}`).join('\n')); @@ -77,7 +77,7 @@ async function main() { run => (ignore_sha || run.head_sha !== headSha) && run.status !== 'completed' && - new Date(run.created_at) < new Date(current_run.created_at) + new Date(run.created_at) < new Date(current_run.created_at), ); console.log(`with ${runningWorkflows.length} runs to cancel.`); @@ -86,7 +86,7 @@ async function main() { const res = await octokit.actions.cancelWorkflowRun({ owner, repo, - run_id: id + run_id: id, }); console.log(`Cancel run ${id} responded with status ${res.status}`); } @@ -95,7 +95,7 @@ async function main() { console.log(`Error while canceling workflow_id ${workflow_id}: ${msg}`); } console.log(''); - }) + }), ); }