diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4ef5d28e06..0f858f4c49 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -117,7 +117,6 @@ If your development box has less than 4 cores, you will need to reduce the numbe Our CI pipeline run tests with 4 agents simultaneously. If new tests are added, please make sure they can run simultaneously. - ### Troubleshooting the test suite We run test suite on every commit and requires 100% test pass. If the test suite did not complete successfully, they are likely: diff --git a/.github/ISSUE_TEMPLATE/question-template.md b/.github/ISSUE_TEMPLATE/question-template.md index e1e0a509e5..539937ccfd 100644 --- a/.github/ISSUE_TEMPLATE/question-template.md +++ b/.github/ISSUE_TEMPLATE/question-template.md @@ -20,5 +20,4 @@ This repo focuses on the development of Web Chat, a client/channel for Bot Frame | Bot Framework Questions | Ask implementation questions related to the BotFramework SDK | https://stackoverflow.com/questions/tagged/botframework | | Bot Builder | A comprehensive list of Bot Framework SDKs and tools | https://github.com/microsoft/BotBuilder | - [Question] diff --git a/README.md b/README.md index e176b3f5fc..63840e5f51 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ This repo is part of the [Microsoft Bot Framework](https://github.com/microsoft/ > This section points out important version notes. For further information, please see the related links and check the [`CHANGELOG.md`](https://github.com/microsoft/BotFramework-WebChat/blob/master/CHANGELOG.md) ## API refactor into new package in Web Chat 4.11.0 -The Web Chat API has been refactored into a separate package. To learn more, check out the [API refactor summary](https://github.com/microsoft/BotFramework-WebChat/pull/3543). +The Web Chat API has been refactored into a separate package. To learn more, check out the [API refactor summary](https://github.com/microsoft/BotFramework-WebChat/pull/3543). ## Direct Line Speech support in Web Chat 4.7.0 diff --git a/packages/api/src/hooks/internal/ErrorBox.js b/packages/api/src/hooks/internal/ErrorBox.js index 69d98ec578..a5437831ac 100644 --- a/packages/api/src/hooks/internal/ErrorBox.js +++ b/packages/api/src/hooks/internal/ErrorBox.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { createElement, useEffect } from 'react'; import PropTypes from 'prop-types'; diff --git a/packages/api/src/hooks/utils/ErrorBoundary.js b/packages/api/src/hooks/utils/ErrorBoundary.js index f7c90af392..ddab8e23bb 100644 --- a/packages/api/src/hooks/utils/ErrorBoundary.js +++ b/packages/api/src/hooks/utils/ErrorBoundary.js @@ -11,13 +11,17 @@ class ErrorBoundary extends Component { } componentDidCatch(error) { + const { onError } = this.props; this.setState({ hasError: true }); - this.props.onError(error); + onError(error); } render() { - return !this.state.hasError && {this.props.children}; + const { children } = this.props; + const { hasError } = this.state; + + return !hasError && {children}; } } diff --git a/packages/api/src/patchStyleOptions.js b/packages/api/src/patchStyleOptions.js index b9d5500608..b50a248695 100644 --- a/packages/api/src/patchStyleOptions.js +++ b/packages/api/src/patchStyleOptions.js @@ -22,6 +22,7 @@ function parseBorder(border) { const PIXEL_UNIT_PATTERN = /^\d+px$/u; +// eslint-disable-next-line complexity export default function patchStyleOptions( options, { groupTimestamp: groupTimestampFromProps, sendTimeout: sendTimeoutFromProps } diff --git a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js index 93d609c098..b7b3dc643b 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js +++ b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js @@ -11,6 +11,7 @@ import useAdaptiveCardsPackage from '../hooks/useAdaptiveCardsPackage'; const { ErrorBox } = Components; const { useDisabled, useLocalizer, usePerformCardAction, useRenderMarkdownAsHTML, useScrollToEnd, useStyleSet } = hooks; +// eslint-disable-next-line no-undef const node_env = process.env.node_env || process.env.NODE_ENV; function addClass(element, className) { diff --git a/packages/bundle/src/adaptiveCards/AttachmentForScreenReader/RichCardAttachment.js b/packages/bundle/src/adaptiveCards/AttachmentForScreenReader/RichCardAttachment.js index 86b2d1d1de..eb49468f12 100644 --- a/packages/bundle/src/adaptiveCards/AttachmentForScreenReader/RichCardAttachment.js +++ b/packages/bundle/src/adaptiveCards/AttachmentForScreenReader/RichCardAttachment.js @@ -1,3 +1,5 @@ +/* eslint-disable react/forbid-dom-props */ +/* eslint-disable react/no-array-index-key */ import PropTypes from 'prop-types'; import React from 'react'; import { hooks } from 'botframework-webchat-component'; diff --git a/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js b/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js index 360c4ccb36..8b3ed82cf1 100644 --- a/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js +++ b/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js @@ -69,7 +69,7 @@ export default function createCognitiveServicesSpeechServicesPonyfillFactory({ // We will not need this code when using Speech SDK 1.14.0 or up. // TODO: [P1] #3575 Remove the following lines when bumping to Speech SDK 1.14.0 or higher source.createAudioContext = () => { - if (!!source.privContext) { + if (!source.privContext) { return; } diff --git a/packages/component/src/BasicTranscript.js b/packages/component/src/BasicTranscript.js index 2af5ff3187..481852573d 100644 --- a/packages/component/src/BasicTranscript.js +++ b/packages/component/src/BasicTranscript.js @@ -704,9 +704,8 @@ const SetScroller = ({ activityElementsRef, scrollerRef }) => { } return values.reduce((minValue, value) => Math.min(minValue, value), Infinity); - } else { - return Infinity; } + return Infinity; }, [ activityElementsRef, diff --git a/packages/component/src/Composer.js b/packages/component/src/Composer.js index df24451ab0..9bc1ab4454 100644 --- a/packages/component/src/Composer.js +++ b/packages/component/src/Composer.js @@ -30,6 +30,7 @@ import WebChatUIContext from './hooks/internal/WebChatUIContext'; const { useReferenceGrammarID, useStyleOptions } = hooks; +// eslint-disable-next-line no-undef const node_env = process.env.node_env || process.env.NODE_ENV; const emotionPool = {}; diff --git a/packages/component/src/ErrorBox.js b/packages/component/src/ErrorBox.js index 120c9dea8a..99339ab9a2 100644 --- a/packages/component/src/ErrorBox.js +++ b/packages/component/src/ErrorBox.js @@ -29,13 +29,10 @@ const ErrorBox = ({ error, type }) => { }; ErrorBox.defaultProps = { - children: undefined, - error: undefined, type: '' }; ErrorBox.propTypes = { - children: PropTypes.any, error: PropTypes.instanceOf(Error).isRequired, type: PropTypes.string }; diff --git a/packages/component/src/Middleware/AttachmentForScreenReader/AudioAttachment.js b/packages/component/src/Middleware/AttachmentForScreenReader/AudioAttachment.js index cdb720dad2..3fe4d8bea8 100644 --- a/packages/component/src/Middleware/AttachmentForScreenReader/AudioAttachment.js +++ b/packages/component/src/Middleware/AttachmentForScreenReader/AudioAttachment.js @@ -1,3 +1,4 @@ +/* eslint-disable react/forbid-dom-props */ import { hooks } from 'botframework-webchat-api'; import React from 'react'; diff --git a/packages/component/src/Middleware/AttachmentForScreenReader/FileAttachment.js b/packages/component/src/Middleware/AttachmentForScreenReader/FileAttachment.js index 752f17eed8..95bc57a2a3 100644 --- a/packages/component/src/Middleware/AttachmentForScreenReader/FileAttachment.js +++ b/packages/component/src/Middleware/AttachmentForScreenReader/FileAttachment.js @@ -1,3 +1,4 @@ +/* eslint-disable react/forbid-dom-props */ import { hooks } from 'botframework-webchat-api'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/packages/component/src/Middleware/AttachmentForScreenReader/ImageAttachment.js b/packages/component/src/Middleware/AttachmentForScreenReader/ImageAttachment.js index 060215e653..f6728db1a1 100644 --- a/packages/component/src/Middleware/AttachmentForScreenReader/ImageAttachment.js +++ b/packages/component/src/Middleware/AttachmentForScreenReader/ImageAttachment.js @@ -1,3 +1,4 @@ +/* eslint-disable react/forbid-dom-props */ import { hooks } from 'botframework-webchat-api'; import React from 'react'; diff --git a/packages/component/src/Middleware/AttachmentForScreenReader/TextAttachment.js b/packages/component/src/Middleware/AttachmentForScreenReader/TextAttachment.js index 0d3d1ab5c5..c6d5cb72e6 100644 --- a/packages/component/src/Middleware/AttachmentForScreenReader/TextAttachment.js +++ b/packages/component/src/Middleware/AttachmentForScreenReader/TextAttachment.js @@ -1,3 +1,4 @@ +/* eslint-disable react/forbid-dom-props */ import { hooks } from 'botframework-webchat-api'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/packages/component/src/Middleware/AttachmentForScreenReader/VideoAttachment.js b/packages/component/src/Middleware/AttachmentForScreenReader/VideoAttachment.js index 04c75041f2..efff299809 100644 --- a/packages/component/src/Middleware/AttachmentForScreenReader/VideoAttachment.js +++ b/packages/component/src/Middleware/AttachmentForScreenReader/VideoAttachment.js @@ -1,3 +1,4 @@ +/* eslint-disable react/forbid-dom-props */ import { hooks } from 'botframework-webchat-api'; import React from 'react'; diff --git a/packages/component/src/hooks/internal/useRegisterScrollToEnd.js b/packages/component/src/hooks/internal/useRegisterScrollToEnd.js index 4033ecf856..91ecbee72a 100644 --- a/packages/component/src/hooks/internal/useRegisterScrollToEnd.js +++ b/packages/component/src/hooks/internal/useRegisterScrollToEnd.js @@ -12,5 +12,5 @@ export default function useRegisterScrollTo(callback) { scrollToEndCallbacks.push(callback); return () => removeInline(scrollToEndCallbacks, callback); - }, [scrollToEndCallbacksRef]); + }, [callback, scrollToEndCallbacksRef]); } diff --git a/packages/directlinespeech/src/createAdapters.js b/packages/directlinespeech/src/createAdapters.js index 129b0bc245..0b201126a3 100644 --- a/packages/directlinespeech/src/createAdapters.js +++ b/packages/directlinespeech/src/createAdapters.js @@ -79,7 +79,7 @@ export default async function create({ const { privSource: source } = audioConfig; source.createAudioContext = () => { - if (!!source.privContext) { + if (!source.privContext) { return; } diff --git a/samples/01.getting-started/i.protocol-direct-line-app-service-extension/README.md b/samples/01.getting-started/i.protocol-direct-line-app-service-extension/README.md index e0a083da31..1ba6e38d22 100644 --- a/samples/01.getting-started/i.protocol-direct-line-app-service-extension/README.md +++ b/samples/01.getting-started/i.protocol-direct-line-app-service-extension/README.md @@ -140,7 +140,7 @@ Check out the hosted samples and source code for other CDN bundle options below. - [Full bundle bot](https://microsoft.github.io/BotFramework-WebChat/01.getting-started/a.full-bundle) | [(Full bundle source code)](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/01.getting-started/a.full-bundle) - [Full bundle with polyfills for ES5 browsers bot](https://microsoft.github.io/BotFramework-WebChat/01.getting-started/c.es5-bundle) | [(Full bundle with polyfills for ES5 browsers source code)](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/01.getting-started/c.es5-bundle) - [Direct Line App Service Extension](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-directline-extension?view=azure-bot-service-4.0) -- [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft.com/en-us/learn/modules/set-up-cors-website-storage/) +- [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft.com/en-us/learn/modules/set-up-cors-website-storage/) ## Full list of Web Chat hosted samples