Skip to content

Commit 7accb9f

Browse files
committed
Refactor: Repo card: Use typedef tags inside data fetcher to resolve eslint errors (anuraghazra#3043)
1 parent 7025afc commit 7accb9f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/fetchers/repo-fetcher.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
import { retryer } from "../common/retryer.js";
33
import { MissingParamError, request } from "../common/utils.js";
44

5+
/**
6+
* @typedef {import('axios').AxiosRequestHeaders} AxiosRequestHeaders Axios request headers.
7+
* @typedef {import('axios').AxiosResponse} AxiosResponse Axios response.
8+
*/
9+
510
/**
611
* Repo data fetcher.
712
*
8-
* @param {import('axios').AxiosRequestHeaders} variables Fetcher variables.
13+
* @param {AxiosRequestHeaders} variables Fetcher variables.
914
* @param {string} token GitHub token.
10-
* @returns {Promise<import('axios').AxiosResponse>} The response.
15+
* @returns {Promise<AxiosResponse>} The response.
1116
*/
1217
const fetcher = (variables, token) => {
1318
return request(
@@ -53,12 +58,16 @@ const fetcher = (variables, token) => {
5358

5459
const urlExample = "/api/pin?username=USERNAME&amp;repo=REPO_NAME";
5560

61+
/**
62+
* @typedef {import("./types").RepositoryData} RepositoryData Repository data.
63+
*/
64+
5665
/**
5766
* Fetch repository data.
5867
*
5968
* @param {string} username GitHub username.
6069
* @param {string} reponame GitHub repository name.
61-
* @returns {Promise<import("./types").RepositoryData>} Repository data.
70+
* @returns {Promise<RepositoryData>} Repository data.
6271
*/
6372
const fetchRepo = async (username, reponame) => {
6473
if (!username && !reponame) {

0 commit comments

Comments
 (0)