Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
N2D4 committed Jun 6, 2024
1 parent 55776dc commit ca7da8d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
10 changes: 5 additions & 5 deletions apps/demo/src/components/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -106,4 +106,4 @@ export default function Provider({ children }) {
</UIProvider>
</>
);
}
}
16 changes: 14 additions & 2 deletions eslint-configs/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 13 additions & 11 deletions packages/stack-shared/src/utils/results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions packages/stack/src/components-core/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ca7da8d

Please sign in to comment.