final lint errors

This commit is contained in:
Kyle Corbitt
2023-06-26 23:46:10 -07:00
parent bca35c9eb2
commit 267a5381f3
4 changed files with 5 additions and 4 deletions

View File

@@ -30,7 +30,6 @@ const config = {
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [

View File

@@ -9,8 +9,9 @@ export default function NewScenarioButton() {
const utils = api.useContext();
const [onClick] = useHandledAsyncCallback(async () => {
if (!experiment.data) return;
await mutation.mutateAsync({
experimentId: experiment.data!.id,
experimentId: experiment.data.id,
});
await utils.scenarios.list.invalidate();
}, [mutation]);

View File

@@ -34,7 +34,7 @@ export const scenariosRouter = createTRPCRouter({
})
)._max.sortIndex ?? 0;
const newScenario = await prisma.testScenario.create({
await prisma.testScenario.create({
data: {
experimentId: input.experimentId,
sortIndex: maxSortIndex + 1,

View File

@@ -12,7 +12,7 @@ export const useExperiment = () => {
return experiment;
};
export function useHandledAsyncCallback<T extends (...args: any[]) => Promise<any>>(
export function useHandledAsyncCallback<T extends (...args: unknown[]) => Promise<unknown>>(
callback: T,
deps: React.DependencyList
) {
@@ -31,6 +31,7 @@ export function useHandledAsyncCallback<T extends (...args: any[]) => Promise<an
.finally(() => {
setLoading(false);
});
/* eslint-disable react-hooks/exhaustive-deps */
}, deps);
return [wrappedCallback, loading, error] as const;