final lint errors
This commit is contained in:
@@ -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": [
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user