add js and ts lints

This commit is contained in:
João Geonizeli
2021-08-04 16:16:10 -03:00
parent 8d089c0b7a
commit d623b653b2
20 changed files with 1129 additions and 108 deletions

View File

@@ -1,11 +1,12 @@
import React, { createContext, Dispatch, FC, SetStateAction, useContext, useState } from 'react'
import type { Dispatch, FC, SetStateAction } from "react";
import React, { createContext, useContext, useState } from "react";
export type AppContext = {
setSideNavExpanded: Dispatch<SetStateAction<boolean>>
sideNavExpanded: boolean
}
setSideNavExpanded: Dispatch<SetStateAction<boolean>>;
sideNavExpanded: boolean;
};
const Context = createContext<AppContext | null>(null)
const Context = createContext<AppContext | null>(null);
export const useAppContext = (): AppContext => {
const context = useContext(Context);
@@ -18,11 +19,11 @@ export const useAppContext = (): AppContext => {
};
export const AppContext: FC = ({ children }) => {
const [sideNavExpanded, setSideNavExpanded] = useState(false)
const [sideNavExpanded, setSideNavExpanded] = useState(false);
return (
return (
<Context.Provider value={{ sideNavExpanded, setSideNavExpanded }}>
{children}
</Context.Provider>
)
}
);
};

View File

@@ -1,13 +1,15 @@
import { Auth0Provider } from '@auth0/auth0-react'
import React, { FC } from 'react'
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { Auth0Provider } from "@auth0/auth0-react";
import type { FC } from "react";
import React from "react";
export const AuthProvider: FC = ({children}) => {
export const AuthProvider: FC = ({ children }) => {
// @ts-ignore
const domain = window.AUTH_DOMAIN
const domain = window.AUTH_DOMAIN;
// @ts-ignore
const clientId = window.AUTH_CLIENT_ID
const clientId = window.AUTH_CLIENT_ID;
// @ts-ignore
const audience = window.AUTH_AUDIENCE
const audience = window.AUTH_AUDIENCE;
return (
<Auth0Provider
@@ -18,5 +20,5 @@ export const AuthProvider: FC = ({children}) => {
>
{children}
</Auth0Provider>
)
}
);
};