[build] upgrade eslint to 9.37.0 (#88)
Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88 Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org> Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import type { AxiosResponse, RawAxiosRequestHeaders } from 'axios';
|
||||
import axios from 'axios';
|
||||
import LinkHeader from 'http-link-header';
|
||||
import { type AxiosResponse, type RawAxiosRequestHeaders } from "axios";
|
||||
import axios from "axios";
|
||||
import LinkHeader from "http-link-header";
|
||||
|
||||
import ready from './ready';
|
||||
import type { GetState } from './store';
|
||||
import ready from "./ready";
|
||||
import { type GetState } from "./store";
|
||||
|
||||
export const getLinks = (response: AxiosResponse) => {
|
||||
const value = response.headers.link as string | undefined;
|
||||
@@ -19,11 +19,11 @@ const csrfHeader: RawAxiosRequestHeaders = {};
|
||||
|
||||
const setCSRFHeader = () => {
|
||||
const csrfToken = document.querySelector<HTMLMetaElement>(
|
||||
'meta[name=csrf-token]',
|
||||
"meta[name=csrf-token]",
|
||||
);
|
||||
|
||||
if (csrfToken) {
|
||||
csrfHeader['X-CSRF-Token'] = csrfToken.content;
|
||||
csrfHeader["X-CSRF-Token"] = csrfToken.content;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ void ready(setCSRFHeader);
|
||||
|
||||
const authorizationHeaderFromState = (getState?: GetState) => {
|
||||
const accessToken =
|
||||
getState && (getState().meta.get('access_token', '') as string);
|
||||
getState && (getState().meta.get("access_token", "") as string);
|
||||
|
||||
if (!accessToken) {
|
||||
return {};
|
||||
@@ -42,7 +42,6 @@ const authorizationHeaderFromState = (getState?: GetState) => {
|
||||
} as RawAxiosRequestHeaders;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function api(getState: GetState) {
|
||||
return axios.create({
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user