Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
corinagum committed Jan 30, 2021
1 parent 0f1a276 commit af17890
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 14 deletions.
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/question-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions packages/api/src/hooks/internal/ErrorBox.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { createElement, useEffect } from 'react';
import PropTypes from 'prop-types';

Expand Down
8 changes: 6 additions & 2 deletions packages/api/src/hooks/utils/ErrorBoundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 && <RenderChildrenFunction>{this.props.children}</RenderChildrenFunction>;
const { children } = this.props;
const { hasError } = this.state;

return !hasError && <RenderChildrenFunction>{children}</RenderChildrenFunction>;
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/api/src/patchStyleOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 1 addition & 2 deletions packages/component/src/BasicTranscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,8 @@ const SetScroller = ({ activityElementsRef, scrollerRef }) => {
}

return values.reduce((minValue, value) => Math.min(minValue, value), Infinity);
} else {
return Infinity;
}
return Infinity;
},
[
activityElementsRef,
Expand Down
1 change: 1 addition & 0 deletions packages/component/src/Composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
3 changes: 0 additions & 3 deletions packages/component/src/ErrorBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react/forbid-dom-props */
import { hooks } from 'botframework-webchat-api';
import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react/forbid-dom-props */
import { hooks } from 'botframework-webchat-api';
import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react/forbid-dom-props */
import { hooks } from 'botframework-webchat-api';
import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export default function useRegisterScrollTo(callback) {
scrollToEndCallbacks.push(callback);

return () => removeInline(scrollToEndCallbacks, callback);
}, [scrollToEndCallbacksRef]);
}, [callback, scrollToEndCallbacksRef]);
}
2 changes: 1 addition & 1 deletion packages/directlinespeech/src/createAdapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default async function create({
const { privSource: source } = audioConfig;

source.createAudioContext = () => {
if (!!source.privContext) {
if (!source.privContext) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit af17890

Please sign in to comment.