Skip to content

Commit 2fe629e

Browse files
committed
linting
1 parent cb00845 commit 2fe629e

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

packages/connect-react/src/components/Control.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { FormContext } from "../hooks/form-context";
22
import { FormFieldContext } from "../hooks/form-field-context";
3-
import { ConfigurableProp, ConfigurableProps } from "@pipedream/sdk";
3+
import {
4+
ConfigurableProp,
5+
ConfigurableProps,
6+
} from "@pipedream/sdk";
47
// import { ControlAny } from "./ControlAny"
58
import { ControlApp } from "./ControlApp";
69
import { ControlBoolean } from "./ControlBoolean";

packages/connect-react/src/components/InternalComponentForm.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import type {
33
CSSProperties, FormEventHandler,
44
} from "react";
55
import { useCustomize } from "../hooks/customization-context";
6-
import { useFormContext, skippablePropTypes } from "../hooks/form-context";
6+
import {
7+
useFormContext,
8+
skippablePropTypes,
9+
} from "../hooks/form-context";
710
import { InternalField } from "./InternalField";
811
import { Alert } from "./Alert";
912
import { ErrorBoundary } from "./ErrorBoundary";

packages/connect-react/src/hooks/form-context.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ export type FormContext<T extends ConfigurableProps> = {
3434
userId: string;
3535
};
3636

37-
export const skippablePropTypes = ["$.service.db", "$.interface.http", "$.interface.apphook"]
37+
export const skippablePropTypes = [
38+
"$.service.db",
39+
"$.interface.http",
40+
"$.interface.apphook",
41+
]
3842

3943
export const FormContext = createContext<FormContext<any /* XXX fix */> | undefined>(undefined); // eslint-disable-line @typescript-eslint/no-explicit-any
4044

@@ -171,8 +175,7 @@ export const FormContextProvider = <T extends ConfigurableProps>({
171175
const propErrors = <T extends ConfigurableProps>(prop: ConfigurableProp, value: unknown): string[] => {
172176
const errs: string[] = [];
173177
if (value === undefined) {
174-
if (prop.optional || prop.hidden || skippablePropTypes.includes(prop.type)) {
175-
} else {
178+
if (!prop.optional && !prop.hidden && !skippablePropTypes.includes(prop.type)) {
176179
errs.push("required");
177180
}
178181
} else if (prop.type === "integer") { // XXX type should be "number"? we don't support floats otherwise...

0 commit comments

Comments
 (0)