diff --git a/.eslintrc b/.eslintrc index cad57471c..a6c315c2d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -138,6 +138,7 @@ "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0, "maxBOF": 1, }], "no-nested-ternary": "off", "no-new-object": "error", + "no-unneeded-ternary": "error", "spaced-comment": ["error", "always", { "block": { "balanced": true, diff --git a/web/base_viewer.js b/web/base_viewer.js index f93985899..78ab1fad9 100644 --- a/web/base_viewer.js +++ b/web/base_viewer.js @@ -768,7 +768,7 @@ class BaseViewer { height = 0, widthScale, heightScale; - const changeOrientation = pageView.rotation % 180 === 0 ? false : true; + const changeOrientation = pageView.rotation % 180 !== 0; const pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale /