Fix lint errors

This commit is contained in:
Stan Wohlwend 2024-06-06 19:23:20 +02:00
parent 55776dcff4
commit ca7da8dff7
4 changed files with 34 additions and 20 deletions

View File

@ -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>
</>
);
}
}

View File

@ -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",

View File

@ -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 = {

View File

@ -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,