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