Skip to content

Commit ad77967

Browse files
committed
added eslint comments
1 parent 0efca45 commit ad77967

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/utils/keyValidators.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@
33
// animation-name
44
const names = (key, propValue) => {
55
if (key === 'name' && typeof propValue[key] !== 'string') {
6+
/* eslint-disable no-console */
67
console.error('Warning: Failed propType. Prop value for animation name should be a string.');
78
}
89
};
910

1011
// animation-duration
1112
const duration = (key, propValue) => {
1213
if (key === 'duration' && typeof propValue[key] !== 'string') {
14+
/* eslint-disable no-console */
1315
console.error('Warning: Failed propType. Prop value for animation duration should be a string. For eg - \'2s\'');
1416
}
1517
};
1618

1719
// animation-timing-function
20+
21+
/* eslint-disable consistent-return */
1822
const timingFunction = (key, propValue) => {
1923
if (key === 'timingFunction' && typeof propValue[key] === 'string') {
2024
const arr = [
@@ -33,6 +37,7 @@ const timingFunction = (key, propValue) => {
3337
"step-start", "step-end"]. Note steps(#, start|end) is currently not supported.
3438
`;
3539

40+
/* eslint-disable no-console */
3641
return arr.includes(propValue[key]) ? null : console.error(err);
3742
} else if (key === 'timingFunction' && typeof propValue[key] !== 'string') {
3843
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) => {
4348

4449
const direction = (key, propValue) => {
4550
if (key === 'direction' && typeof propValue[key] !== 'string') {
51+
/* eslint-disable no-console */
4652
console.error('Warning: Failed propType. Prop value for "direction" should be a string.');
4753
}
4854
};
@@ -51,6 +57,7 @@ const interpolateValidators = (key) => {
5157
const keys = ['steps', 'direction'];
5258
const err = `Warning: Unknown prop '${key}' passed to the Merge component.`;
5359

60+
/* eslint-disable no-console */
5461
return keys.includes(key) ? null : console.error(err);
5562
};
5663

@@ -60,6 +67,7 @@ const propValidators = (key) => {
6067
const keys = ['name', 'duration', 'timingFunction'];
6168
const err = `Warning: Unknown prop '${key}' passed to the Merge component. Prop should be one of [${keys}]`;
6269

70+
/* eslint-disable no-console */
6371
return keys.includes(key) ? null : console.error(err);
6472
};
6573

0 commit comments

Comments
 (0)