3
3
// animation-name
4
4
const names = ( key , propValue ) => {
5
5
if ( key === 'name' && typeof propValue [ key ] !== 'string' ) {
6
+ /* eslint-disable no-console */
6
7
console . error ( 'Warning: Failed propType. Prop value for animation name should be a string.' ) ;
7
8
}
8
9
} ;
9
10
10
11
// animation-duration
11
12
const duration = ( key , propValue ) => {
12
13
if ( key === 'duration' && typeof propValue [ key ] !== 'string' ) {
14
+ /* eslint-disable no-console */
13
15
console . error ( 'Warning: Failed propType. Prop value for animation duration should be a string. For eg - \'2s\'' ) ;
14
16
}
15
17
} ;
16
18
17
19
// animation-timing-function
20
+
21
+ /* eslint-disable consistent-return */
18
22
const timingFunction = ( key , propValue ) => {
19
23
if ( key === 'timingFunction' && typeof propValue [ key ] === 'string' ) {
20
24
const arr = [
@@ -33,6 +37,7 @@ const timingFunction = (key, propValue) => {
33
37
"step-start", "step-end"]. Note steps(#, start|end) is currently not supported.
34
38
` ;
35
39
40
+ /* eslint-disable no-console */
36
41
return arr . includes ( propValue [ key ] ) ? null : console . error ( err ) ;
37
42
} else if ( key === 'timingFunction' && typeof propValue [ key ] !== 'string' ) {
38
43
console . error ( 'Warning: Failed propType. Prop value for tf should be a string. For eg - \'ease-out\'' ) ;
@@ -43,6 +48,7 @@ const timingFunction = (key, propValue) => {
43
48
44
49
const direction = ( key , propValue ) => {
45
50
if ( key === 'direction' && typeof propValue [ key ] !== 'string' ) {
51
+ /* eslint-disable no-console */
46
52
console . error ( 'Warning: Failed propType. Prop value for "direction" should be a string.' ) ;
47
53
}
48
54
} ;
@@ -51,6 +57,7 @@ const interpolateValidators = (key) => {
51
57
const keys = [ 'steps' , 'direction' ] ;
52
58
const err = `Warning: Unknown prop '${ key } ' passed to the Merge component.` ;
53
59
60
+ /* eslint-disable no-console */
54
61
return keys . includes ( key ) ? null : console . error ( err ) ;
55
62
} ;
56
63
@@ -60,6 +67,7 @@ const propValidators = (key) => {
60
67
const keys = [ 'name' , 'duration' , 'timingFunction' ] ;
61
68
const err = `Warning: Unknown prop '${ key } ' passed to the Merge component. Prop should be one of [${ keys } ]` ;
62
69
70
+ /* eslint-disable no-console */
63
71
return keys . includes ( key ) ? null : console . error ( err ) ;
64
72
} ;
65
73
0 commit comments