chore: fix all Typescript warnings (#8618)
* [CAL-1517] fix all Typescript warnings * solve conflicts * Update stripeCheckoutSession.handler.ts Parse is a guard, so even though the variable is unused the parse itself is needed. * Update ToolbarPlugin.tsx Don't change dependency tree --------- Co-authored-by: gitstart-calcom <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
106 files changed
+425
-319
No files matched your search
@@ -146,6 +146,7 @@ export function AllApps({ apps, searchText, categories }: AllAppsPropsType) {
|
||||
? router.query.category
|
||||
: null;
|
||||
setSelectedCategory(queryCategory);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [router.query.category]);
|
||||
|
||||
const filteredApps = apps
|
||||
|
||||
@@ -44,7 +44,7 @@ export type TextEditorProps = {
|
||||
|
||||
const editorConfig = {
|
||||
theme: ExampleTheme,
|
||||
onError(error: any) {
|
||||
onError(error: Error) {
|
||||
throw error;
|
||||
},
|
||||
namespace: "",
|
||||
|
||||
@@ -7,7 +7,7 @@ const EMAIL_MATCHER =
|
||||
/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
|
||||
|
||||
const MATCHERS = [
|
||||
(text: any) => {
|
||||
(text: string) => {
|
||||
const match = URL_MATCHER.exec(text);
|
||||
return (
|
||||
match && {
|
||||
@@ -18,7 +18,7 @@ const MATCHERS = [
|
||||
}
|
||||
);
|
||||
},
|
||||
(text: any) => {
|
||||
(text: string) => {
|
||||
const match = EMAIL_MATCHER.exec(text);
|
||||
return (
|
||||
match && {
|
||||
|
||||
@@ -358,6 +358,7 @@ export default function ToolbarPlugin(props: TextEditorProps) {
|
||||
}
|
||||
});
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [props.updateTemplate]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -381,6 +382,7 @@ export default function ToolbarPlugin(props: TextEditorProps) {
|
||||
});
|
||||
});
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -392,7 +394,7 @@ export default function ToolbarPlugin(props: TextEditorProps) {
|
||||
}),
|
||||
editor.registerCommand(
|
||||
SELECTION_CHANGE_COMMAND,
|
||||
(_payload, newEditor) => {
|
||||
(_payload, _newEditor) => {
|
||||
updateToolbar();
|
||||
return false;
|
||||
},
|
||||
|
||||
@@ -14,13 +14,12 @@ export type Option = {
|
||||
label: string;
|
||||
};
|
||||
|
||||
const InputOption: React.FC<OptionProps<any, boolean, GroupBase<any>>> = ({
|
||||
const InputOption: React.FC<OptionProps<unknown, boolean, GroupBase<unknown>>> = ({
|
||||
isDisabled,
|
||||
isFocused,
|
||||
isSelected,
|
||||
children,
|
||||
innerProps,
|
||||
className,
|
||||
...rest
|
||||
}) => {
|
||||
const props = {
|
||||
@@ -52,7 +51,7 @@ type MultiSelectionCheckboxesProps = {
|
||||
setValue: (s: Option[]) => unknown;
|
||||
};
|
||||
|
||||
const MultiValue = ({ index, getValue }: { index: number; getValue: any }) => {
|
||||
const MultiValue = ({ index, getValue }: { index: number; getValue: () => { length: number } }) => {
|
||||
const { t } = useLocale();
|
||||
|
||||
return <>{!index && <div>{t("nr_event_type", { count: getValue().length })}</div>}</>;
|
||||
@@ -72,6 +71,7 @@ export default function MultiSelectCheckboxes({
|
||||
return (
|
||||
<Select
|
||||
value={selected}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
onChange={(s: any) => {
|
||||
setSelected(s);
|
||||
setValue(s);
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Label } from "./Label";
|
||||
type InputProps = JSX.IntrinsicElements["input"] & { isFullWidth?: boolean; isStandaloneField?: boolean };
|
||||
|
||||
export const Input = forwardRef<HTMLInputElement, InputProps>(function Input(
|
||||
{ isFullWidth = true, isStandaloneField = true, ...props },
|
||||
{ isFullWidth = true, ...props },
|
||||
ref
|
||||
) {
|
||||
return (
|
||||
|
||||
@@ -21,7 +21,7 @@ const initialMeta: MetaType = {
|
||||
const MetaContext = createContext({
|
||||
meta: initialMeta,
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
setMeta: (newMeta: Partial<MetaType>) => {},
|
||||
setMeta: (_newMeta: Partial<MetaType>) => {},
|
||||
});
|
||||
|
||||
export function useMeta() {
|
||||
|
||||
@@ -22,7 +22,7 @@ export const AnimatedPopover = ({
|
||||
React.useEffect(() => {
|
||||
const handleResize = () => {
|
||||
const halfWidth = window.innerWidth / 2;
|
||||
const { x, y } = ref?.current?.getBoundingClientRect() || {
|
||||
const { x } = ref?.current?.getBoundingClientRect() || {
|
||||
x: 0,
|
||||
y: 0,
|
||||
};
|
||||
|
||||
@@ -67,7 +67,7 @@ export function UnstyledSelect<
|
||||
Option,
|
||||
IsMulti extends boolean = false,
|
||||
Group extends GroupBase<Option> = GroupBase<Option>
|
||||
>({ className, ...props }: SelectProps<Option, IsMulti, Group>) {
|
||||
>({ ...props }: SelectProps<Option, IsMulti, Group>) {
|
||||
return (
|
||||
<ReactSelect
|
||||
{...props}
|
||||
|
||||
@@ -90,7 +90,7 @@ const InputField = forwardRef<HTMLInputElement, InputFieldProps>(function InputF
|
||||
<Alert
|
||||
className="mt-1"
|
||||
severity="error"
|
||||
message={<>{methods.formState.errors[props.name]!.message}</>}
|
||||
message={<>{methods.formState.errors[props.name]?.message}</>}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -186,7 +186,7 @@ export const TextAreaField = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>
|
||||
<Alert
|
||||
className="mt-1"
|
||||
severity="error"
|
||||
message={<>{methods.formState.errors[props.name]!.message}</>}
|
||||
message={<>{methods.formState.errors[props.name]?.message}</>}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user