From e1c58c2aafe5d58b3238124e246b88fdd11823ee Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 15 Jan 2024 11:03:47 +0100 Subject: [PATCH] Merge pull request #15710 from overleaf/tm-no-constant-binary-expressions Add no-constant-binary-expression, fix existing expressions that have no effect GitOrigin-RevId: 6691e87181331ecbb5dabfda0be89839a0a4884b --- services/web/.eslintrc | 2 ++ .../source-editor/components/figure-modal/figure-modal.tsx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/web/.eslintrc b/services/web/.eslintrc index e897b06892..17ce9968ca 100644 --- a/services/web/.eslintrc +++ b/services/web/.eslintrc @@ -18,6 +18,8 @@ } }, "rules": { + "no-constant-binary-expression": "error", + // do not allow importing of implicit dependencies. "import/no-extraneous-dependencies": "error", diff --git a/services/web/frontend/js/features/source-editor/components/figure-modal/figure-modal.tsx b/services/web/frontend/js/features/source-editor/components/figure-modal/figure-modal.tsx index 163561856a..929c73f543 100644 --- a/services/web/frontend/js/features/source-editor/components/figure-modal/figure-modal.tsx +++ b/services/web/frontend/js/features/source-editor/components/figure-modal/figure-modal.tsx @@ -217,8 +217,8 @@ const FigureModalContent = () => { '\\begin{figure}', '\t\\centering', `\t\\includegraphics${widthArgument}{${path}}`, - `\t${captionCommand}` || null, - `\t${labelCommand}` || null, + `\t${captionCommand}`, + `\t${labelCommand}`, `\\end{figure}${suffix}`, ], view.state,