diff options
author | Nathan Friend <nathan@gitlab.com> | 2019-06-04 01:51:02 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2019-06-04 01:51:02 +0300 |
commit | bee3c7e847e4c682f3b808ebfddcc0b6746c2d60 (patch) | |
tree | ddac4275d2f6da90e0e5651c5d030d861425a7d9 /app/assets/javascripts/image_diff | |
parent | deebe0bf1ed222450092397e683dff746c7979b3 (diff) |
Comply with `no-implicit-coercion` rule (CE)
This commit is the result of running `yarn eslint --fix` after enabling
the `no-implicit-coercion` ESLint rule. This rule has been added to
our ESLint config here:
https://gitlab.com/gitlab-org/gitlab-eslint-config/merge_requests/14
Diffstat (limited to 'app/assets/javascripts/image_diff')
-rw-r--r-- | app/assets/javascripts/image_diff/helpers/comment_indicator_helper.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/image_diff/image_diff.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/image_diff/view_types.js | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/image_diff/helpers/comment_indicator_helper.js b/app/assets/javascripts/image_diff/helpers/comment_indicator_helper.js index 05000c73052..7051a968dac 100644 --- a/app/assets/javascripts/image_diff/helpers/comment_indicator_helper.js +++ b/app/assets/javascripts/image_diff/helpers/comment_indicator_helper.js @@ -14,7 +14,7 @@ export function addCommentIndicator(containerEl, { x, y }) { export function removeCommentIndicator(imageFrameEl) { const commentIndicatorEl = imageFrameEl.querySelector('.comment-indicator'); const imageEl = imageFrameEl.querySelector('img'); - const willRemove = !!commentIndicatorEl; + const willRemove = Boolean(commentIndicatorEl); let meta = {}; if (willRemove) { diff --git a/app/assets/javascripts/image_diff/image_diff.js b/app/assets/javascripts/image_diff/image_diff.js index 3587f073a00..26c1b0ec7be 100644 --- a/app/assets/javascripts/image_diff/image_diff.js +++ b/app/assets/javascripts/image_diff/image_diff.js @@ -6,8 +6,8 @@ import { isImageLoaded } from '../lib/utils/image_utility'; export default class ImageDiff { constructor(el, options) { this.el = el; - this.canCreateNote = !!(options && options.canCreateNote); - this.renderCommentBadge = !!(options && options.renderCommentBadge); + this.canCreateNote = Boolean(options && options.canCreateNote); + this.renderCommentBadge = Boolean(options && options.renderCommentBadge); this.$noteContainer = $('.note-container', this.el); this.imageBadges = []; } diff --git a/app/assets/javascripts/image_diff/view_types.js b/app/assets/javascripts/image_diff/view_types.js index ab0a595571f..1a5123de220 100644 --- a/app/assets/javascripts/image_diff/view_types.js +++ b/app/assets/javascripts/image_diff/view_types.js @@ -5,5 +5,5 @@ export const viewTypes = { }; export function isValidViewType(validate) { - return !!Object.getOwnPropertyNames(viewTypes).find(viewType => viewType === validate); + return Boolean(Object.getOwnPropertyNames(viewTypes).find(viewType => viewType === validate)); } |