final lint errors
This commit is contained in:
@@ -30,7 +30,6 @@ const config = {
|
|||||||
fixStyle: "inline-type-imports",
|
fixStyle: "inline-type-imports",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
|
|
||||||
|
|
||||||
"unused-imports/no-unused-imports": "error",
|
"unused-imports/no-unused-imports": "error",
|
||||||
"unused-imports/no-unused-vars": [
|
"unused-imports/no-unused-vars": [
|
||||||
|
|||||||
@@ -9,8 +9,9 @@ export default function NewScenarioButton() {
|
|||||||
const utils = api.useContext();
|
const utils = api.useContext();
|
||||||
|
|
||||||
const [onClick] = useHandledAsyncCallback(async () => {
|
const [onClick] = useHandledAsyncCallback(async () => {
|
||||||
|
if (!experiment.data) return;
|
||||||
await mutation.mutateAsync({
|
await mutation.mutateAsync({
|
||||||
experimentId: experiment.data!.id,
|
experimentId: experiment.data.id,
|
||||||
});
|
});
|
||||||
await utils.scenarios.list.invalidate();
|
await utils.scenarios.list.invalidate();
|
||||||
}, [mutation]);
|
}, [mutation]);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const scenariosRouter = createTRPCRouter({
|
|||||||
})
|
})
|
||||||
)._max.sortIndex ?? 0;
|
)._max.sortIndex ?? 0;
|
||||||
|
|
||||||
const newScenario = await prisma.testScenario.create({
|
await prisma.testScenario.create({
|
||||||
data: {
|
data: {
|
||||||
experimentId: input.experimentId,
|
experimentId: input.experimentId,
|
||||||
sortIndex: maxSortIndex + 1,
|
sortIndex: maxSortIndex + 1,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const useExperiment = () => {
|
|||||||
return experiment;
|
return experiment;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function useHandledAsyncCallback<T extends (...args: any[]) => Promise<any>>(
|
export function useHandledAsyncCallback<T extends (...args: unknown[]) => Promise<unknown>>(
|
||||||
callback: T,
|
callback: T,
|
||||||
deps: React.DependencyList
|
deps: React.DependencyList
|
||||||
) {
|
) {
|
||||||
@@ -31,6 +31,7 @@ export function useHandledAsyncCallback<T extends (...args: any[]) => Promise<an
|
|||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
}, deps);
|
}, deps);
|
||||||
|
|
||||||
return [wrappedCallback, loading, error] as const;
|
return [wrappedCallback, loading, error] as const;
|
||||||
|
|||||||
Reference in New Issue
Block a user