diff options
author | 2023-05-04 23:22:17 +0800 | |
---|---|---|
committer | 2023-05-04 23:22:17 +0800 | |
commit | b6dc0edc94cebdee74d67f5919f46c28cd96b9f8 (patch) | |
tree | ef97add33058dd7f65e662f402cf7ce24b7482e8 /source/features/github-actions-indicators.tsx | |
parent | 0f0d7435a649466084fab40bb7fe0481b0c73dba (diff) | |
download | refined-github-b6dc0edc94cebdee74d67f5919f46c28cd96b9f8.tar.gz refined-github-b6dc0edc94cebdee74d67f5919f46c28cd96b9f8.tar.zst refined-github-b6dc0edc94cebdee74d67f5919f46c28cd96b9f8.zip |
Lint (ESM file imports + named functions) (#6613)
Diffstat (limited to 'source/features/github-actions-indicators.tsx')
-rw-r--r-- | source/features/github-actions-indicators.tsx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/features/github-actions-indicators.tsx b/source/features/github-actions-indicators.tsx index a73b9df6..8fecf4d3 100644 --- a/source/features/github-actions-indicators.tsx +++ b/source/features/github-actions-indicators.tsx @@ -5,10 +5,10 @@ import {StopIcon, PlayIcon} from '@primer/octicons-react'; import {parseCron} from '@cheap-glitch/mi-cron'; import * as pageDetect from 'github-url-detection'; -import features from '../feature-manager'; -import * as api from '../github-helpers/api'; -import {cacheByRepo} from '../github-helpers'; -import observe from '../helpers/selector-observer'; +import features from '../feature-manager.js'; +import * as api from '../github-helpers/api.js'; +import {cacheByRepo} from '../github-helpers/index.js'; +import observe from '../helpers/selector-observer.js'; type Workflow = { name: string; @@ -31,7 +31,7 @@ function addTooltip(element: HTMLElement, tooltip: string): void { } // There is no way to get a workflow list in the v4 API #6543 -const getWorkflows = async (): Promise<Workflow[]> => { +async function getWorkflows(): Promise<Workflow[]> { const response = await api.v3('actions/workflows'); const workflows = response.workflows as any[]; @@ -42,9 +42,9 @@ const getWorkflows = async (): Promise<Workflow[]> => { name: workflow.path.split('/').pop()!, isEnabled: workflow.state === 'active', })); -}; +} -const getFilesInWorkflowPath = async (): Promise<Record<string, string>> => { +async function getFilesInWorkflowPath(): Promise<Record<string, string>> { const {repository: {workflowFiles}} = await api.v4(` repository() { workflowFiles: object(expression: "HEAD:.github/workflows") { @@ -70,7 +70,7 @@ const getFilesInWorkflowPath = async (): Promise<Record<string, string>> => { } return result; -}; +} const getWorkflowsDetails = cache.function('workflows-details', async (): Promise<Record<string, Workflow & WorkflowDetails>> => { const [workflows, workflowFiles] = await Promise.all([getWorkflows(), getFilesInWorkflowPath()]); |