Skip to content

Commit b375bf3

Browse files
committed
lint 1
1 parent 0f1f0c9 commit b375bf3

File tree

5 files changed

+93
-79
lines changed

5 files changed

+93
-79
lines changed
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
"use server"
1+
"use server";
22

3-
import {
4-
createBackendClient,
5-
type ProjectEnvironment
6-
} from "@pipedream/sdk/server"
3+
import {
4+
createBackendClient,
5+
type ProjectEnvironment,
6+
} from "@pipedream/sdk/server";
77

88
const {
99
NODE_ENV,
1010
PIPEDREAM_ALLOWED_ORIGINS,
1111
PIPEDREAM_CLIENT_ID,
1212
PIPEDREAM_CLIENT_SECRET,
1313
PIPEDREAM_PROJECT_ID,
14-
} = process.env
14+
} = process.env;
1515

1616
if (!NODE_ENV) {
17-
throw new Error("NODE_ENV is required")
17+
throw new Error("NODE_ENV is required");
1818
}
1919

2020
if (!PIPEDREAM_ALLOWED_ORIGINS) {
21-
throw new Error("PIPEDREAM_ALLOWED_ORIGINS is required")
21+
throw new Error("PIPEDREAM_ALLOWED_ORIGINS is required");
2222
}
2323

24-
let allowedOrigins: string[] = []
24+
let allowedOrigins: string[] = [];
2525
try {
26-
allowedOrigins = JSON.parse(PIPEDREAM_ALLOWED_ORIGINS)
26+
allowedOrigins = JSON.parse(PIPEDREAM_ALLOWED_ORIGINS);
2727
} catch (e) {
28-
throw new Error("PIPEDREAM_ALLOWED_ORIGINS must be a valid JSON array")
28+
throw new Error("PIPEDREAM_ALLOWED_ORIGINS must be a valid JSON array");
2929
}
3030
if (!Array.isArray(allowedOrigins)) {
31-
throw new Error("PIPEDREAM_ALLOWED_ORIGINS must be a JSON array")
31+
throw new Error("PIPEDREAM_ALLOWED_ORIGINS must be a JSON array");
3232
}
3333

3434
if (!PIPEDREAM_CLIENT_ID) {
35-
throw new Error("PIPEDREAM_CLIENT_ID is required")
35+
throw new Error("PIPEDREAM_CLIENT_ID is required");
3636
}
3737

3838
if (!PIPEDREAM_CLIENT_SECRET) {
39-
throw new Error("PIPEDREAM_CLIENT_SECRET is required")
39+
throw new Error("PIPEDREAM_CLIENT_SECRET is required");
4040
}
4141

4242
if (!PIPEDREAM_PROJECT_ID) {
43-
throw new Error("PIPEDREAM_PROJECT_ID is required")
43+
throw new Error("PIPEDREAM_PROJECT_ID is required");
4444
}
4545

4646
const client = createBackendClient({
@@ -50,11 +50,11 @@ const client = createBackendClient({
5050
clientId: PIPEDREAM_CLIENT_ID,
5151
clientSecret: PIPEDREAM_CLIENT_SECRET,
5252
},
53-
})
53+
});
5454

55-
export async function fetchToken(opts: { externalUserId: string }) {
55+
export async function fetchToken(opts: { externalUserId: string; }) {
5656
return await client.createConnectToken({
5757
external_user_id: opts.externalUserId,
5858
allowed_origins: allowedOrigins,
59-
})
59+
});
6060
}

packages/connect-react/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "./polyfills"
1+
import "./polyfills";
22
/* eslint-disable object-curly-newline */
33
export { Alert } from "./components/Alert";
44
export { ComponentForm } from "./components/ComponentForm";

packages/connect-react/src/polyfills.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
if (typeof document === "undefined") {
55
globalThis.document = {
66
createElement: () => {},
7-
} as any
7+
} as any;
88
}
Lines changed: 68 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,94 @@
11
import {
22
defaultTheme as reactSelectDefaultTheme,
33
type Theme as ReactSelectTheme,
4-
} from "react-select"
4+
} from "react-select";
55

66
export type Colors = {
77
// select.control:boxShadow
88
// select.control:focused:borderColor
99
// select.control:hover:focused:borderColor
1010
// select.option:active:selected:backgroundColor
1111
// select.option:selected:backgroundColor
12-
primary: string
13-
primary75: string
12+
primary: string;
13+
primary75: string;
1414
// select.option:active:not(selected):backgroundColor
15-
primary50: string
15+
primary50: string;
1616
// select.option:focused:backgroundColor
17-
primary25: string
17+
primary25: string;
1818

1919
// select.multiValueRemove:hover:color
20-
danger: string
20+
danger: string;
2121
// select.multiValueRemove:focused:backgroundColor
2222
// select.multiValueRemove:hover:backgroundColor
23-
dangerLight: string
23+
dangerLight: string;
2424

2525
// select.control:backgroundColor
2626
// select.menu:backgroundColor
2727
// select.multiValue:backgroundColor
2828
// select.option:selected:color
29-
neutral0: string
29+
neutral0: string;
3030
// select.control:disabled:backgroundColor
31-
neutral5: string
31+
neutral5: string;
3232
// select.control:disabled:borderColor
3333
// select.indicatorSeparator:disabled:backgroundColor
34-
neutral10: string
34+
neutral10: string;
3535
// select.control:borderColor
3636
// select.indicatorContainer:color
3737
// select.indicatorSeparator:backgroundColor
3838
// select.loadingIndicator:color
3939
// select.option:disabled:color
40-
neutral20: string
40+
neutral20: string;
4141
// select.control:hover:not(focused):borderColor
42-
neutral30: string
42+
neutral30: string;
4343
// select.groupHeading:color
4444
// select.indicatorContainer:hover:not(focused):color
4545
// select.notice:color
4646
// select.singleValue:disabled:color
47-
neutral40: string
47+
neutral40: string;
4848
// select.placeholder:color
49-
neutral50: string
49+
neutral50: string;
5050
// select.indicatorContainer:focused:color
5151
// select.loadingIndicator:focused:color
52-
neutral60: string
53-
neutral70: string
52+
neutral60: string;
53+
neutral70: string;
5454
// select.indicatorContainer:hover:focused:color
5555
// select.input:color
5656
// select.multiValueLabel:color
5757
// select.singleValue:color
58-
neutral80: string
59-
neutral90: string
60-
}
58+
neutral80: string;
59+
neutral90: string;
60+
};
6161

6262
export type Shadows = {
63-
button: string
64-
input: string
65-
card: string
66-
dropdown: string
67-
}
63+
button: string;
64+
input: string;
65+
card: string;
66+
dropdown: string;
67+
};
6868

6969
export type ThemeSpacing = {
70-
baseUnit: number
70+
baseUnit: number;
7171
// The minimum height of the control
72-
controlHeight: number
72+
controlHeight: number;
7373
// The amount of space between the control and menu
74-
menuGutter: number
75-
}
74+
menuGutter: number;
75+
};
7676

7777
export type Theme = {
78-
borderRadius?: number | string
79-
colors: Partial<Colors>
80-
spacing: ThemeSpacing
81-
boxShadow: Shadows
82-
}
78+
borderRadius?: number | string;
79+
colors: Partial<Colors>;
80+
spacing: ThemeSpacing;
81+
boxShadow: Shadows;
82+
};
8383

8484
export type PartialTheme = {
85-
borderRadius?: Theme["borderRadius"]
86-
colors?: Partial<Colors>
87-
spacing?: Partial<ThemeSpacing>
88-
boxShadow?: Partial<Shadows>
89-
}
85+
borderRadius?: Theme["borderRadius"];
86+
colors?: Partial<Colors>;
87+
spacing?: Partial<ThemeSpacing>;
88+
boxShadow?: Partial<Shadows>;
89+
};
9090

91-
export type CustomThemeConfig = PartialTheme | ((theme: Theme) => PartialTheme)
91+
export type CustomThemeConfig = PartialTheme | ((theme: Theme) => PartialTheme);
9292

9393
export const defaultTheme: Theme = {
9494
borderRadius: 4,
@@ -126,7 +126,7 @@ export const defaultTheme: Theme = {
126126
controlHeight: 32,
127127
menuGutter: 8,
128128
},
129-
}
129+
};
130130

131131
export const unstyledTheme: Theme = {
132132
colors: {},
@@ -141,25 +141,29 @@ export const unstyledTheme: Theme = {
141141
card: "none",
142142
dropdown: "none",
143143
},
144-
}
144+
};
145145

146146
export function getReactSelectTheme(
147-
theme: CustomThemeConfig | undefined
147+
theme: CustomThemeConfig | undefined,
148148
): ReactSelectTheme {
149-
if (!theme) return reactSelectDefaultTheme
150-
const _theme = typeof theme == "function" ? theme(defaultTheme) : theme
151-
const { colors, spacing, borderRadius } = mergeTheme(
149+
if (!theme) return reactSelectDefaultTheme;
150+
const _theme = typeof theme == "function"
151+
? theme(defaultTheme)
152+
: theme;
153+
const {
154+
colors, spacing, borderRadius,
155+
} = mergeTheme(
152156
reactSelectDefaultTheme,
153-
_theme
154-
)
157+
_theme,
158+
);
155159
return {
156160
borderRadius:
157161
typeof borderRadius !== "number"
158162
? reactSelectDefaultTheme.borderRadius
159163
: borderRadius,
160164
colors: colors as ReactSelectTheme["colors"],
161165
spacing,
162-
}
166+
};
163167
}
164168

165169
export function mergeTheme(
@@ -168,16 +172,22 @@ export function mergeTheme(
168172
): Theme {
169173
const merged = {
170174
borderRadius: target.borderRadius,
171-
colors: { ...target.colors },
172-
spacing: { ...target.spacing },
173-
boxShadow: { ...target.boxShadow },
174-
}
175+
colors: {
176+
...target.colors,
177+
},
178+
spacing: {
179+
...target.spacing,
180+
},
181+
boxShadow: {
182+
...target.boxShadow,
183+
},
184+
};
175185
for (const source of sources) {
176-
if (!source) continue
177-
merged.borderRadius = source.borderRadius ?? merged.borderRadius
178-
Object.assign(merged.boxShadow, source.boxShadow)
179-
Object.assign(merged.colors, source.colors)
180-
Object.assign(merged.spacing, source.spacing)
186+
if (!source) continue;
187+
merged.borderRadius = source.borderRadius ?? merged.borderRadius;
188+
Object.assign(merged.boxShadow, source.boxShadow);
189+
Object.assign(merged.colors, source.colors);
190+
Object.assign(merged.spacing, source.spacing);
181191
}
182-
return merged
192+
return merged;
183193
}

packages/connect-react/vite.config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ export default defineConfig({
1111
fileName: (format) => `connect-react.${format}.js`,
1212
},
1313
rollupOptions: {
14-
external: ["react", "react-dom", "react/jsx-runtime"],
14+
external: [
15+
"react",
16+
"react-dom",
17+
"react/jsx-runtime",
18+
],
1519
},
1620
},
1721
plugins: [

0 commit comments

Comments
 (0)