Refactor: Use typedef tags inside request utils function to resolve eslint errors (#3054)

This commit is contained in:
Alexandr Garbuzov
2023-08-08 08:32:15 +02:00
committed by GitHub
parent c165525fc7
commit 879dbf1a59
+7 -3
View File
@@ -149,15 +149,19 @@ const fallbackColor = (color, fallbackColor) => {
);
};
/**
* @typedef {import('axios').AxiosRequestConfig['data']} AxiosRequestConfigData Axios request data.
* @typedef {import('axios').AxiosRequestConfig['headers']} AxiosRequestConfigHeaders Axios request headers.
*/
/**
* Send GraphQL request to GitHub API.
*
* @param {import('axios').AxiosRequestConfig['data']} data Request data.
* @param {import('axios').AxiosRequestConfig['headers']} headers Request headers.
* @param {AxiosRequestConfigData} data Request data.
* @param {AxiosRequestConfigHeaders} headers Request headers.
* @returns {Promise<any>} Request response.
*/
const request = (data, headers) => {
// @ts-ignore
return axios({
url: "https://api.github.com/graphql",
method: "post",