Build/Refactor: lint pre-commit hook and reformat repo to spec (#314)

* build/refactor: move lint/prettier packages to project root, install husky, add pre-commit hook

* refactor: reformat files

* build: put full eslintrc back with all rules
This commit is contained in:
Dan Orlando 2023-05-18 11:09:31 -07:00 committed by GitHub
parent 8d75b25104
commit 7fdc862042
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
157 changed files with 4836 additions and 2403 deletions

View file

@ -1,32 +1,28 @@
import axios, { AxiosRequestConfig } from "axios";
import axios, { AxiosRequestConfig } from 'axios';
async function _get<T>(url: string, options?: AxiosRequestConfig): Promise<T> {
const response = await axios.get(url, { ...options});
const response = await axios.get(url, { ...options });
return response.data;
}
async function _post(url: string, data?: any) {
const response = await axios.post(url, JSON.stringify(data), {
headers: { "Content-Type": "application/json" },
headers: { 'Content-Type': 'application/json' }
});
return response.data;
}
async function _postMultiPart(
url: string,
formData: FormData,
options?: AxiosRequestConfig
) {
async function _postMultiPart(url: string, formData: FormData, options?: AxiosRequestConfig) {
const response = await axios.post(url, formData, {
...options,
headers: { "Content-Type": "multipart/form-data" },
headers: { 'Content-Type': 'multipart/form-data' }
});
return response.data;
}
async function _put(url: string, data?: any) {
const response = await axios.put(url, JSON.stringify(data), {
headers: { "Content-Type": "application/json" },
headers: { 'Content-Type': 'application/json' }
});
return response.data;
}
@ -36,17 +32,14 @@ async function _delete<T>(url: string): Promise<T> {
return response.data;
}
async function _deleteWithOptions<T>(
url: string,
options?: AxiosRequestConfig
): Promise<T> {
const response = await axios.delete(url, {...options});
async function _deleteWithOptions<T>(url: string, options?: AxiosRequestConfig): Promise<T> {
const response = await axios.delete(url, { ...options });
return response.data;
}
async function _patch(url: string, data?: any) {
const response = await axios.patch(url, JSON.stringify(data), {
headers: { "Content-Type": "application/json" },
headers: { 'Content-Type': 'application/json' }
});
return response.data;
}
@ -58,5 +51,5 @@ export default {
put: _put,
delete: _delete,
deleteWithOptions: _deleteWithOptions,
patch: _patch,
patch: _patch
};