فهرست منبع

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
Thomas 2 سال پیش
والد
کامیت
e1c58c2aaf
2فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 2 0
      services/web/.eslintrc
  2. 2 2
      services/web/frontend/js/features/source-editor/components/figure-modal/figure-modal.tsx

+ 2 - 0
services/web/.eslintrc

@@ -18,6 +18,8 @@
     }
     }
   },
   },
   "rules": {
   "rules": {
+    "no-constant-binary-expression": "error",
+
     // do not allow importing of implicit dependencies.
     // do not allow importing of implicit dependencies.
     "import/no-extraneous-dependencies": "error",
     "import/no-extraneous-dependencies": "error",
 
 

+ 2 - 2
services/web/frontend/js/features/source-editor/components/figure-modal/figure-modal.tsx

@@ -217,8 +217,8 @@ const FigureModalContent = () => {
                 '\\begin{figure}',
                 '\\begin{figure}',
                 '\t\\centering',
                 '\t\\centering',
                 `\t\\includegraphics${widthArgument}{${path}}`,
                 `\t\\includegraphics${widthArgument}{${path}}`,
-                `\t${captionCommand}` || null,
-                `\t${labelCommand}` || null,
+                `\t${captionCommand}`,
+                `\t${labelCommand}`,
                 `\\end{figure}${suffix}`,
                 `\\end{figure}${suffix}`,
               ],
               ],
               view.state,
               view.state,