mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Fix lint errors
This commit is contained in:
parent
55776dcff4
commit
ca7da8dff7
@ -19,10 +19,10 @@ const CurrentUIContext = React.createContext<{
|
||||
const ThemeContext = React.createContext<{
|
||||
theme: 'dark' | 'light',
|
||||
setTheme: (theme: 'dark' | 'light') => void,
|
||||
}>({
|
||||
theme: 'light',
|
||||
setTheme: () => {},
|
||||
});
|
||||
}>({
|
||||
theme: 'light',
|
||||
setTheme: () => {},
|
||||
});
|
||||
|
||||
export function useCurrentUI() {
|
||||
return React.useContext(CurrentUIContext);
|
||||
@ -106,4 +106,4 @@ export default function Provider({ children }) {
|
||||
</UIProvider>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,8 +8,20 @@ module.exports = {
|
||||
tsconfigRootDir: process.cwd(),
|
||||
},
|
||||
rules: {
|
||||
"indent": "off",
|
||||
"@typescript-eslint/indent": ["warn", 2, { SwitchCase: 1 }],
|
||||
"indent": ["warn", 2, {
|
||||
SwitchCase: 1,
|
||||
ignoredNodes: [
|
||||
"TSIntersectionType",
|
||||
"TSTypeParameter",
|
||||
"TSTypeParameterDeclaration",
|
||||
"TSTypeParameterInstantiation",
|
||||
"TSUnionType",
|
||||
"ConditionalType",
|
||||
"TSConditionalType",
|
||||
"FunctionDeclaration",
|
||||
"CallExpression",
|
||||
],
|
||||
}],
|
||||
semi: ["error", "always"],
|
||||
"no-fallthrough": "error",
|
||||
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
||||
|
||||
@ -3,22 +3,24 @@ import { deindent } from "./strings";
|
||||
|
||||
export type Result<T, E = unknown> =
|
||||
| {
|
||||
status: "ok",
|
||||
data: T,
|
||||
}
|
||||
status: "ok",
|
||||
data: T,
|
||||
}
|
||||
| {
|
||||
status: "error",
|
||||
error: E,
|
||||
};
|
||||
status: "error",
|
||||
error: E,
|
||||
};
|
||||
|
||||
export type AsyncResult<T, E = unknown, P = void> =
|
||||
| Result<T, E>
|
||||
| & {
|
||||
status: "pending",
|
||||
}
|
||||
| (
|
||||
& {
|
||||
progress: P,
|
||||
};
|
||||
status: "pending",
|
||||
}
|
||||
& {
|
||||
progress: P,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
export const Result = {
|
||||
|
||||
@ -10,12 +10,12 @@ import { ReloadIcon } from "@radix-ui/react-icons";
|
||||
function getColors({
|
||||
propsColor,
|
||||
colors,
|
||||
variant,
|
||||
variant,
|
||||
}: {
|
||||
propsColor?: string,
|
||||
colors: { primaryColor: string, secondaryColor: string, backgroundColor: string },
|
||||
variant: 'primary' | 'secondary' | 'warning',
|
||||
}): {
|
||||
}): {
|
||||
bgColor: string,
|
||||
hoverBgColor: string,
|
||||
activeBgColor: string,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user