Skip to content

Commit

Permalink
Fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Jul 1, 2019
1 parent 2e2b726 commit fab4470
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/component/src/Activity/Bubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ Bubble.defaultProps = {
children: undefined,
className: '',
fromUser: false,
hideNub: false
nub: true
};

Bubble.propTypes = {
'aria-hidden': PropTypes.bool,
children: PropTypes.any,
className: PropTypes.string,
fromUser: PropTypes.bool,
hideNub: PropTypes.bool,
nub: PropTypes.bool,
styleSet: PropTypes.shape({
bubble: PropTypes.any.isRequired
}).isRequired
Expand Down
2 changes: 2 additions & 0 deletions packages/component/src/Activity/CarouselFilmStrip.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ const WebChatCarouselFilmStrip = ({
};

WebChatCarouselFilmStrip.defaultProps = {
avatarInitials: '',
children: undefined,
className: '',
timestampClassName: ''
Expand All @@ -171,6 +172,7 @@ WebChatCarouselFilmStrip.propTypes = {
textFormat: PropTypes.string,
timestamp: PropTypes.string
}).isRequired,
avatarInitials: PropTypes.string,
children: PropTypes.any,
className: PropTypes.string,
itemContainerRef: PropTypes.any.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion packages/component/src/Activity/StackedLayout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-sync */
/* eslint react/no-array-index-key: "off" */
/* eslint-disable no-sync */

import { Constants } from 'botframework-webchat-core';
import { css } from 'glamor';
Expand Down
8 changes: 5 additions & 3 deletions packages/component/src/Styles/StyleSet/Bubble.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 10] }] */

import Color from 'color';

function acuteNubSVG(nubSize = 10, backgroundColor, color, strokeWidth = 1, side = 'bot', upSideDown = false) {
Expand Down Expand Up @@ -25,7 +27,7 @@ function isPositive(value) {
}

function svgToDataURI(svg) {
return `data:image/svg+xml;utf8,${svg.replace(/"/g, "'")}`;
return `data:image/svg+xml;utf8,${svg.replace(/"/gu, "'")}`;
}

export default function createBubbleStyle({
Expand Down Expand Up @@ -111,7 +113,7 @@ export default function createBubbleStyle({
},

'& > .nub': {
backgroundImage: `url("${svgToDataURI(botNubSVG).replace(/"/g, "'")}")`,
backgroundImage: `url("${svgToDataURI(botNubSVG).replace(/"/gu, "'")}")`,
bottom: isPositive(bubbleNubOffset) ? undefined : -bubbleNubOffset,
height: bubbleNubSize,
left: bubbleBorderWidth - bubbleNubSize + paddingRegular,
Expand Down Expand Up @@ -142,7 +144,7 @@ export default function createBubbleStyle({
},

'& > .nub': {
backgroundImage: `url("${svgToDataURI(userNubSVG).replace(/"/g, "'")}")`,
backgroundImage: `url("${svgToDataURI(userNubSVG).replace(/"/gu, "'")}")`,
height: bubbleFromUserNubSize,
right: bubbleFromUserBorderWidth - bubbleFromUserNubSize + paddingRegular,
bottom: isPositive(bubbleFromUserNubOffset) ? undefined : -bubbleFromUserNubOffset,
Expand Down
2 changes: 2 additions & 0 deletions packages/component/src/Styles/StyleSet/CarouselFilmStrip.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint no-magic-numbers: ["error", { "ignore": [2] }] */

export default function CarouselFilmStrip({ bubbleMaxWidth, bubbleMinWidth, paddingRegular }) {
return {
// Browser quirks: Firefox has no way to hide scrollbar and while keeping it in function
Expand Down
2 changes: 2 additions & 0 deletions packages/component/src/Styles/StyleSet/StackedLayout.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint no-magic-numbers: ["error", { "ignore": [2] }] */

export default function createStackedLayoutStyle({ bubbleMaxWidth, bubbleMinWidth, paddingRegular }) {
return {
'&.extra-left-indent': {
Expand Down
6 changes: 3 additions & 3 deletions packages/component/src/Styles/createStyleSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function parseBorder(border) {
};
}

const PIXEL_UNIT_PATTERN = /^\d+px$/;
const PIXEL_UNIT_PATTERN = /^\d+px$/u;

export default function createStyleSet(options) {
options = { ...defaultStyleOptions, ...options };
Expand All @@ -84,7 +84,7 @@ export default function createStyleSet(options) {
}

if (PIXEL_UNIT_PATTERN.test(width)) {
options.bubbleBorderWidth = parseInt(width);
options.bubbleBorderWidth = parseInt(width, 10);
}
}

Expand All @@ -104,7 +104,7 @@ export default function createStyleSet(options) {
}

if (PIXEL_UNIT_PATTERN.test(width)) {
options.bubbleFromUserBorderWidth = parseInt(width);
options.bubbleFromUserBorderWidth = parseInt(width, 10);
}
}

Expand Down

0 comments on commit fab4470

Please sign in to comment.