fixes eslint

This commit is contained in:
Gustavo Fuhr 2022-11-30 04:02:55 -03:00
parent 40e9acc5a8
commit bbb14eaeb6
7 changed files with 29 additions and 9 deletions

View File

@ -30,6 +30,7 @@
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-unused-vars": "error",
"react/no-unknown-property": ["error", { "ignore": ["css"] }],
"react-hooks/rules-of-hooks": "warn", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"no-restricted-imports": [

View File

@ -408,16 +408,15 @@ class MockClient implements Client {
return Promise.resolve();
}
wait(ms: number) {
console.log('Start waiting');
return new Promise((resolve, reject) => {
wait(ms: number): Promise<number> {
return new Promise((resolve) => {
setTimeout(() => {
console.log('Done waiting');
resolve(ms);
}, ms);
});
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
processGoogleCallback(code: string): Promise<Oauth2CallbackResult> {
// artificial delay for more realistic mock experience
const handler = (success: (result: Oauth2CallbackResult) => void) => {
@ -436,6 +435,7 @@ class MockClient implements Client {
return new Promise(handler);
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
confirmAccountSync(email: string, code: string): Promise<void> {
return Promise.resolve();
}

View File

@ -659,7 +659,7 @@ export default class RestClient implements Client {
.put(`${this.baseUrl}/service/users/confirmAccountSync?email=${email}&code=${code}`, {
headers: { 'Content-Type': 'application/json' },
})
.then((response) => {
.then(() => {
success();
})
.catch((error) => {

View File

@ -1,10 +1,10 @@
import React from 'react';
import { css } from '@emotion/react';
import { Button } from '@mui/material';
import GoogleIcon from '../google-icon';
const googleButtonStyle = css({
color: '#000000',
//fontSize: "15px",
fontWeight: '300',
border: '1px solid black',
'&:hover': {
@ -12,7 +12,15 @@ const googleButtonStyle = css({
},
});
const GoogleButton = ({ text, onClick }) => {
type GoogleButtonProps = {
text: string;
onClick: React.MouseEventHandler<HTMLButtonElement>;
};
const GoogleButton: React.FunctionComponent<GoogleButtonProps> = ({
text,
onClick,
}: GoogleButtonProps) => {
return (
<Button variant="outlined" css={googleButtonStyle} startIcon={GoogleIcon} onClick={onClick}>
{text}

View File

@ -1,3 +1,4 @@
import React from 'react';
import { SvgIcon } from '@mui/material';
const GoogleIconSvg = () => {

View File

@ -1,7 +1,18 @@
import React from 'react';
import { css } from '@emotion/react';
import { useTheme } from '@mui/material/styles';
const Separator = ({ responsive, text, maxWidth = undefined }) => {
type SeparatorProps = {
responsive: boolean;
text: string;
maxWidth?: number;
};
const Separator: React.FunctionComponent<SeparatorProps> = ({
responsive,
text,
maxWidth = undefined,
}: SeparatorProps) => {
const theme = useTheme();
const containerStyle = css([

View File

@ -21,7 +21,6 @@ const RegistrationCallbackPage = (): React.ReactElement => {
const [email, setEmail] = useState(undefined);
const [syncCode, setSyncCode] = useState(undefined);
const [googleSync, setGoogleSync] = useState(undefined);
const history = useHistory();
useEffect(() => {