Skip to content

Commit

Permalink
chore: fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémy Baranx committed Feb 13, 2024
1 parent 37d8d3e commit 5dfe0c4
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions components/Editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,17 @@ const Editor = ({ readOnly = false }: Props) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [settingsLoaded && router.isReady])

const logDiagnostics = (diagnostics: string[]) => {
for (const diagnostic of diagnostics) {
const type = diagnostic.startsWith('error') ? LogType.Error : LogType.Warn
log(diagnostic, type)
}
}
const logDiagnostics = useCallback(
(diagnostics: string[]) => {
for (const diagnostic of diagnostics) {
const type = diagnostic.startsWith('error')
? LogType.Error
: LogType.Warn
log(diagnostic, type)
}
},
[log],
)

useEffect(() => {
if (isCompiling === CompilationState.Compiling) {
Expand All @@ -117,7 +122,7 @@ const Editor = ({ readOnly = false }: Props) => {
} else if (isCompiling === CompilationState.Error) {
logDiagnostics(diagnostics)
}
}, [isCompiling, log, serializedOutput])
}, [isCompiling, serializedOutput, diagnostics, log, logDiagnostics])

const handleCairoCodeChange = (value: string) => {
setCairoCode(value)
Expand Down

0 comments on commit 5dfe0c4

Please sign in to comment.