Skip to content

Commit 3374383

Browse files
committed
Refactor to use @imports
1 parent 8a3542e commit 3374383

File tree

15 files changed

+23
-40
lines changed

15 files changed

+23
-40
lines changed

lib/collective/configure.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
3-
* @typedef {import('../util/types.js').GraphQl} GraphQl
4-
* @typedef {import('@octokit/graphql').GraphqlResponseError<unknown>} GraphqlResponseError
2+
* @import {graphql as GraphQl, GraphqlResponseError} from '@octokit/graphql'
3+
* @import {Context} from '../util/types.js'
54
*/
65

76
import {graphql} from '@octokit/graphql'
@@ -59,7 +58,7 @@ function wrap(action) {
5958
* @returns
6059
*/
6160
function retry(error) {
62-
const exception = /** @type {GraphqlResponseError} */ (error)
61+
const exception = /** @type {GraphqlResponseError<unknown>} */ (error)
6362
console.log('wrap err:', exception)
6463
console.log('to do:', 'does `status` really not exist?')
6564
const after =

lib/collective/labels.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
3-
* @typedef {import('../util/types.js').Label} Label
4-
* @typedef {import('../util/types.js').Labels} Labels
2+
* @import {ScaleLinear} from 'd3-scale'
3+
* @import {Context, Labels, Label} from '../util/types.js'
54
*/
65

76
/**
@@ -103,7 +102,7 @@ export async function labels(context) {
103102
*/
104103
function addAll(group) {
105104
const {labels, color} = group
106-
/** @type {import('d3-scale').ScaleLinear<number, string, unknown> | undefined} */
105+
/** @type {ScaleLinear<number, string, unknown> | undefined} */
107106
let scale
108107

109108
if (typeof color !== 'string' && color.from && color.to) {

lib/collective/orgs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
2+
* @import {Context} from '../util/types.js'
33
*/
44

55
import {promisify} from 'node:util'

lib/org/people.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
2+
* @import {Context} from '../util/types.js'
33
*/
44

55
import chalk from 'chalk'

lib/org/repos.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
3-
* @typedef {import('../util/types.js').Repo} Repo
2+
* @import {Context, Repo} from '../util/types.js'
43
*/
54

65
import {promisify} from 'node:util'

lib/org/teams.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
2+
* @import {Context} from '../util/types.js'
33
*/
44

55
import {promisify} from 'node:util'

lib/repo/collaborators.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
3-
* @typedef {import('../util/types.js').Repo} Repo
2+
* @import {Context, Repo} from '../util/types.js'
43
*/
54

65
import chalk from 'chalk'

lib/repo/labels.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
3-
* @typedef {import('../util/types.js').Label} Label
4-
* @typedef {import('../util/types.js').Repo} Repo
2+
* @import {Context, Label, Repo} from '../util/types.js'
53
*/
64

75
import assert from 'node:assert/strict'

lib/team/create.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
3-
* @typedef {import('../util/types.js').GithubTeam} GithubTeam
4-
* @typedef {import('../util/types.js').TeamInfo} TeamInfo
2+
* @import {Context, GithubTeam, TeamInfo} from '../util/types.js'
53
*/
64

75
import chalk from 'chalk'

lib/team/members.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/**
2-
* @typedef {import('../util/types.js').Context} Context
3-
* @typedef {import('../util/types.js').GithubTeam} GithubTeam
4-
* @typedef {import('../util/types.js').TeamInfo} TeamInfo
2+
* @import {Context, GithubTeam, TeamInfo} from '../util/types.js'
53
*/
64

75
import difference from 'arr-diff'

0 commit comments

Comments
 (0)