File tree Expand file tree Collapse file tree 5 files changed +31
-12
lines changed
Expand file tree Collapse file tree 5 files changed +31
-12
lines changed Original file line number Diff line number Diff line change 1313 "no-return-assign": 0,
1414 "guard-for-in": 0,
1515 "no-restricted-syntax": 0,
16+ "no-param-reassign": 0,
17+ "react/no-will-update-set-state": 0,
18+ "new-cap": 0,
1619 }
1720}
Original file line number Diff line number Diff line change @@ -86,7 +86,8 @@ export default class Recognition {
8686 onResult ( event ) {
8787 let interimTranscript = '' ;
8888 let finalTranscript = '' ;
89- for ( let i = event . resultIndex ; i < event . results . length ; ++ i ) {
89+
90+ for ( let i = event . resultIndex ; i < event . results . length ; i += 1 ) {
9091 if ( event . results [ i ] . isFinal ) {
9192 finalTranscript += event . results [ i ] [ 0 ] . transcript ;
9293 this . onFinal ( finalTranscript ) ;
@@ -117,7 +118,10 @@ export default class Recognition {
117118 if ( ! Recognition . isSupported ( ) ) {
118119 return this ;
119120 }
120- this . recognition = new window . webkitSpeechRecognition ( ) ;
121+
122+ const { webkitSpeechRecognition } = window ;
123+
124+ this . recognition = new webkitSpeechRecognition ( ) ;
121125 this . recognition . continuous = true ;
122126 this . recognition . interimResults = true ;
123127 this . recognition . lang = this . state . lang ;
Original file line number Diff line number Diff line change @@ -57,13 +57,19 @@ class CustomStep extends Component {
5757}
5858
5959CustomStep . propTypes = {
60+ previousStep : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
61+ previousValue : PropTypes . oneOfType ( [
62+ PropTypes . string ,
63+ PropTypes . bool ,
64+ PropTypes . number ,
65+ PropTypes . object ,
66+ PropTypes . array ,
67+ ] ) ,
68+ speak : PropTypes . func ,
6069 step : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
6170 steps : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
6271 style : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
63- previousStep : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
6472 triggerNextStep : PropTypes . func . isRequired ,
65- previousValue : PropTypes . any ,
66- speak : PropTypes . func ,
6773} ;
6874CustomStep . defaultProps = {
6975 previousValue : '' ,
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ class OptionsStep extends Component {
4949}
5050
5151OptionsStep . propTypes = {
52+ bubbleOptionStyle : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
5253 step : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
5354 triggerNextStep : PropTypes . func . isRequired ,
54- bubbleOptionStyle : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
5555} ;
5656
5757export default OptionsStep ;
Original file line number Diff line number Diff line change @@ -108,25 +108,31 @@ class TextStep extends Component {
108108}
109109
110110TextStep . propTypes = {
111+ avatarStyle : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
111112 isFirst : PropTypes . bool . isRequired ,
112113 isLast : PropTypes . bool . isRequired ,
113- step : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
114- triggerNextStep : PropTypes . func . isRequired ,
115- speak : PropTypes . func ,
116- avatarStyle : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
117114 bubbleStyle : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
118115 hideBotAvatar : PropTypes . bool . isRequired ,
119116 hideUserAvatar : PropTypes . bool . isRequired ,
120117 previousStep : PropTypes . objectOf ( PropTypes . any ) ,
121- previousValue : PropTypes . any ,
118+ previousValue : PropTypes . oneOfType ( [
119+ PropTypes . string ,
120+ PropTypes . bool ,
121+ PropTypes . number ,
122+ PropTypes . object ,
123+ PropTypes . array ,
124+ ] ) ,
125+ speak : PropTypes . func ,
126+ step : PropTypes . objectOf ( PropTypes . any ) . isRequired ,
122127 steps : PropTypes . objectOf ( PropTypes . any ) ,
128+ triggerNextStep : PropTypes . func . isRequired ,
123129} ;
124130
125131TextStep . defaultProps = {
126132 previousStep : { } ,
127- steps : { } ,
128133 previousValue : '' ,
129134 speak : ( ) => { } ,
135+ steps : { } ,
130136} ;
131137
132138export default TextStep ;
You can’t perform that action at this time.
0 commit comments