From 09fb5d6b5f913c3d9a232e7a9daf218990de1d74 Mon Sep 17 00:00:00 2001 From: Stan Dzhumaev Date: Mon, 16 Dec 2024 13:29:03 -0800 Subject: [PATCH] [AXON-38] chore: silence old linter warnings from React --- src/react/atlascode/common/editor/MarkdownEditor.tsx | 2 +- src/react/atlascode/common/form/useFormValidation.tsx | 2 +- src/react/atlascode/config/auth/AuthDialog.tsx | 4 ++-- src/react/atlascode/pipelines/PipelineSummaryPage.tsx | 2 +- src/react/atlascode/pullrequest/InlineRenderedTextEditor.tsx | 2 +- src/webviews/components/RenderedContent.tsx | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/react/atlascode/common/editor/MarkdownEditor.tsx b/src/react/atlascode/common/editor/MarkdownEditor.tsx index 595a865b..c8914402 100644 --- a/src/react/atlascode/common/editor/MarkdownEditor.tsx +++ b/src/react/atlascode/common/editor/MarkdownEditor.tsx @@ -177,7 +177,7 @@ export const MarkdownEditor: React.FC = (props: PropsType) => { setContent(''); } props.onCancel?.(); - }, [enableRichTextEditor, props.onCancel]); + }, [enableRichTextEditor, props.onCancel]); // eslint-disable-line react-hooks/exhaustive-deps const handleSave = useCallback(async () => { const mdContent: string = enableRichTextEditor ? mdSerializer.serialize(view.current!.state.doc) : content; diff --git a/src/react/atlascode/common/form/useFormValidation.tsx b/src/react/atlascode/common/form/useFormValidation.tsx index 558e8fbe..28ccf165 100644 --- a/src/react/atlascode/common/form/useFormValidation.tsx +++ b/src/react/atlascode/common/form/useFormValidation.tsx @@ -228,7 +228,7 @@ export function useFormValidation(watch?: Partial): Form } return { - register: useCallback(register, []), + register: useCallback(register, []), // eslint-disable-line react-hooks/exhaustive-deps watches: watches.current, errors: errors.current, handleSubmit, diff --git a/src/react/atlascode/config/auth/AuthDialog.tsx b/src/react/atlascode/config/auth/AuthDialog.tsx index 2ad0bb05..f5a3c717 100644 --- a/src/react/atlascode/config/auth/AuthDialog.tsx +++ b/src/react/atlascode/config/auth/AuthDialog.tsx @@ -203,8 +203,8 @@ export const AuthDialog: React.FunctionComponent = memo( [], ); - const registerUrl = useCallback(register(validateStartsWithProtocol), []); - const registerRequiredString = useCallback(register(validateRequiredString), []); + const registerUrl = useCallback(register(validateStartsWithProtocol), []); // eslint-disable-line react-hooks/exhaustive-deps + const registerRequiredString = useCallback(register(validateRequiredString), []); // eslint-disable-line react-hooks/exhaustive-deps return ( diff --git a/src/react/atlascode/pipelines/PipelineSummaryPage.tsx b/src/react/atlascode/pipelines/PipelineSummaryPage.tsx index 4f7545bd..0344c1c4 100644 --- a/src/react/atlascode/pipelines/PipelineSummaryPage.tsx +++ b/src/react/atlascode/pipelines/PipelineSummaryPage.tsx @@ -484,7 +484,7 @@ const PipelineSummaryPage: React.FunctionComponent = () => { ); }, - [classes.loglessStepHeader, classes.stepHeader, controller.fetchLogs, stepHeader], + [classes.loglessStepHeader, classes.stepHeader, controller.fetchLogs, stepHeader], // eslint-disable-line react-hooks/exhaustive-deps ); const renderPipelineStep = useCallback( diff --git a/src/react/atlascode/pullrequest/InlineRenderedTextEditor.tsx b/src/react/atlascode/pullrequest/InlineRenderedTextEditor.tsx index f32c3f3f..dd6b0664 100644 --- a/src/react/atlascode/pullrequest/InlineRenderedTextEditor.tsx +++ b/src/react/atlascode/pullrequest/InlineRenderedTextEditor.tsx @@ -52,7 +52,7 @@ const InlineRenderedTextEditor: React.FC = (props: Inline await props.onSave?.(value); exitEditMode(); }, - [exitEditMode, props.onSave], + [exitEditMode, props.onSave], // eslint-disable-line react-hooks/exhaustive-deps ); return editMode ? ( diff --git a/src/webviews/components/RenderedContent.tsx b/src/webviews/components/RenderedContent.tsx index 1c52b1de..69138a3f 100644 --- a/src/webviews/components/RenderedContent.tsx +++ b/src/webviews/components/RenderedContent.tsx @@ -34,7 +34,7 @@ export const RenderedContent: React.FC = (props: Props) => { }, { capture: true }, ); - }, [props.fetchImage, ref]); + }, [props.fetchImage, ref]); // eslint-disable-line react-hooks/exhaustive-deps return

; };