mirror of
https://github.com/spacebarchat/client.git
synced 2024-11-25 11:42:30 +01:00
lint
This commit is contained in:
parent
7555f81ef4
commit
9797007d3b
@ -5,8 +5,9 @@
|
|||||||
"root": true,
|
"root": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-mixed-spaces-and-tabs": "off",
|
"no-mixed-spaces-and-tabs": "off",
|
||||||
"@typescript-eslint/no-inferrable-types": "off", // Required by typeorm
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
"@typescript-eslint/no-var-requires": "off" // Sometimes requred by typeorm to resolve circular deps
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": "off"
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"node": true
|
"node": true
|
||||||
|
@ -107,7 +107,7 @@ export class DOBInput extends Component<Props, State> {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidUpdate(prevProps: any, prevState: any) {
|
componentDidUpdate(prevProps: Props, prevState: State) {
|
||||||
if (prevState !== this.state) {
|
if (prevState !== this.state) {
|
||||||
this.props.onErrorChange(this.state.errors);
|
this.props.onErrorChange(this.state.errors);
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ interface Props {
|
|||||||
captchaRef: React.RefObject<HCaptchaLib>;
|
captchaRef: React.RefObject<HCaptchaLib>;
|
||||||
onLoad?: () => void;
|
onLoad?: () => void;
|
||||||
onChalExpired?: () => void;
|
onChalExpired?: () => void;
|
||||||
onError?: (e: any) => void;
|
onError?: (e: unknown) => void;
|
||||||
onExpire?: () => void;
|
onExpire?: () => void;
|
||||||
onVerify?: (token: string) => void;
|
onVerify?: (token: string) => void;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ function Icon(props: IconProps) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const { iconName, ...propSpread } = props;
|
const { iconName, ...propSpread } = props;
|
||||||
return <ElementIcon {...propSpread} />;
|
return <ElementIcon {...propSpread} />;
|
||||||
}
|
}
|
||||||
|
@ -56,11 +56,11 @@ const Header = styled.h1`
|
|||||||
color: var(--text);
|
color: var(--text);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const SubHeader = styled.h2`
|
// const SubHeader = styled.h2`
|
||||||
color: var(--text-muted);
|
// color: var(--text-muted);
|
||||||
font-weight: 400;
|
// font-weight: 400;
|
||||||
font-size: 16px;
|
// font-size: 16px;
|
||||||
`;
|
// `;
|
||||||
|
|
||||||
const FormContainer = styled.form`
|
const FormContainer = styled.form`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -164,7 +164,7 @@ function RegistrationPage() {
|
|||||||
clearErrors,
|
clearErrors,
|
||||||
} = useForm<FormValues>();
|
} = useForm<FormValues>();
|
||||||
|
|
||||||
const dobRegister = register("date_of_birth", {
|
const _ = register("date_of_birth", {
|
||||||
required: true,
|
required: true,
|
||||||
pattern: /^\d{4}-\d{2}-\d{2}$/,
|
pattern: /^\d{4}-\d{2}-\d{2}$/,
|
||||||
});
|
});
|
||||||
|
@ -12,10 +12,10 @@ export default class AccountStore {
|
|||||||
@observable avatar: string | null;
|
@observable avatar: string | null;
|
||||||
@observable avatarDecoration?: unknown;
|
@observable avatarDecoration?: unknown;
|
||||||
@observable email: string | null = null;
|
@observable email: string | null = null;
|
||||||
@observable verified: boolean = false;
|
@observable verified = false;
|
||||||
@observable bot: boolean = false;
|
@observable bot = false;
|
||||||
@observable system: boolean = false;
|
@observable system = false;
|
||||||
@observable mfaEnabled: boolean = false;
|
@observable mfaEnabled = false;
|
||||||
@observable premiumType?:
|
@observable premiumType?:
|
||||||
| UserPremiumType.NitroClassic
|
| UserPremiumType.NitroClassic
|
||||||
| UserPremiumType.Nitro
|
| UserPremiumType.Nitro
|
||||||
|
@ -47,8 +47,8 @@ export default class GatewayConnectionStore {
|
|||||||
private dispatchHandlers: Map<GatewayDispatchEvents, Function> = new Map();
|
private dispatchHandlers: Map<GatewayDispatchEvents, Function> = new Map();
|
||||||
private connectionStartTime?: number;
|
private connectionStartTime?: number;
|
||||||
private identifyStartTime?: number;
|
private identifyStartTime?: number;
|
||||||
private sequence: number = 0;
|
private sequence = 0;
|
||||||
private heartbeatAck: boolean = true;
|
private heartbeatAck = true;
|
||||||
private lazyRequestChannels = new Map<string, Snowflake[]>(); // guild, channels
|
private lazyRequestChannels = new Map<string, Snowflake[]>(); // guild, channels
|
||||||
|
|
||||||
constructor(app: AppStore) {
|
constructor(app: AppStore) {
|
||||||
@ -154,6 +154,7 @@ export default class GatewayConnectionStore {
|
|||||||
this.handleIdentify();
|
this.handleIdentify();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
private onmessage = (e: MessageEvent<any>) => {
|
private onmessage = (e: MessageEvent<any>) => {
|
||||||
const payload: GatewayReceivePayload = JSON.parse(e.data);
|
const payload: GatewayReceivePayload = JSON.parse(e.data);
|
||||||
if (payload.op !== GatewayOpcodes.Dispatch) {
|
if (payload.op !== GatewayOpcodes.Dispatch) {
|
||||||
|
@ -13,11 +13,11 @@ export default class User {
|
|||||||
@observable username: string;
|
@observable username: string;
|
||||||
@observable discriminator: string;
|
@observable discriminator: string;
|
||||||
@observable avatar: string | null;
|
@observable avatar: string | null;
|
||||||
@observable bot: boolean = false;
|
@observable bot = false;
|
||||||
@observable public_flags: number = 0;
|
@observable public_flags = 0;
|
||||||
@observable bio: string = "";
|
@observable bio = "";
|
||||||
@observable premium_since: string | null = null;
|
@observable premium_since: string | null = null;
|
||||||
@observable premium_type: number = 0;
|
@observable premium_type = 0;
|
||||||
@observable accent_color: unknown | null;
|
@observable accent_color: unknown | null;
|
||||||
@observable pronouns?: string;
|
@observable pronouns?: string;
|
||||||
@observable theme_colors?: unknown;
|
@observable theme_colors?: unknown;
|
||||||
|
@ -2,6 +2,7 @@ export type OneKeyFrom<
|
|||||||
T,
|
T,
|
||||||
M = object,
|
M = object,
|
||||||
K extends keyof T = keyof T,
|
K extends keyof T = keyof T,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
> = K extends any
|
> = K extends any
|
||||||
? M &
|
? M &
|
||||||
Pick<Required<T>, K> &
|
Pick<Required<T>, K> &
|
||||||
|
@ -24,6 +24,7 @@ export function messageFromFieldError(
|
|||||||
return r ? { field: prevKey, error: r.message } : null;
|
return r ? { field: prevKey, error: r.message } : null;
|
||||||
}
|
}
|
||||||
if (typeof obj === "object") {
|
if (typeof obj === "object") {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
return messageFromFieldError(obj as any, key);
|
return messageFromFieldError(obj as any, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user