Skip to content

Commit 79f2325

Browse files
committed
chore: clean code (linter warnings)
1 parent f6d2210 commit 79f2325

File tree

10 files changed

+18
-9
lines changed

10 files changed

+18
-9
lines changed

src/CCardLink.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint react/prop-types: 0 */
12
import React from 'react'
23
import CLink from './CLink'
34

src/CCarouselItem.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ const CCarouselItem = props => {
5252
}
5353

5454
const onEntering = (node) => {
55+
/* eslint-disable no-unused-vars */
5556
const offsetHeight = node.offsetHeight
5657
setAnimating(true)
57-
// return offsetHeight
58+
/* eslint-enable no-unused-vars */
5859
}
5960

6061
const onExit = () => {

src/CCol.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
44
import {mapToCssModules, tagPropType} from './Shared/helper.js';
5-
import isObject from 'lodash.isobject';
65

76
const colWidths = ['xs', 'sm', 'md', 'lg', 'xl'];
87
const stringOrNumberProp = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);
@@ -50,7 +49,7 @@ const CCol = props=>{
5049
return;
5150
}
5251
const isXs = !i;
53-
if (isObject(columnProp)) {
52+
if (typeof columnProp === 'object') {
5453
const colSizeInterfix = isXs ? '-' : `-${colWidth}-`;
5554
const colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);
5655

src/CCollapse.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import React, {useState} from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import {mapToCssModules, omit, pick, TransitionTimeouts, TransitionPropTypeKeys, TransitionStatuses, tagPropType} from './Shared/helper.js';
4+
import {
5+
mapToCssModules,
6+
omit,
7+
pick,
8+
TransitionTimeouts,
9+
TransitionPropTypeKeys,
10+
TransitionStatuses
11+
} from './Shared/helper.js';
512
import {Transition} from 'react-transition-group';
613

714
const transitionStatusToClassHash = {

src/CHeaderBrand.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint react/prop-types: 0 */
12
import React from 'react'
23
import CBrand from './CBrand'
34

src/CInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { mapToCssModules, tagPropType } from './Shared/helper.js'
4+
import { mapToCssModules } from './Shared/helper.js'
55

66
//component - CoreUI / CInput
77
const commonPropTypes = {

src/CNavbarBrand.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
/* eslint react/prop-types: 0 */
12
import React from 'react'
23
import CBrand from './CBrand'
34

45
//component - CoreUI / CNavbarBrand
5-
66
const CNavbarBrand = props => {
77
return (
88
<CBrand {...props} className={['navbar-brand', props.className]}/>

src/CSidebarBrand.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
/* eslint react/prop-types: 0 */
12
import React from 'react'
23
import CBrand from './CBrand'
34

45
//component - CoreUI / CSidebarBrand
5-
66
const CSidebarBrand = props => {
77
return (
88
<CBrand {...props} className={['c-sidebar-brand', props.className]}/>

src/CSidebarNav.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const CSidebarNav = props => {
3737

3838
CSidebarNav.propTypes = {
3939
className: PropTypes.string,
40+
children: PropTypes.node,
4041
//
4142
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
4243
};

src/Shared/helper.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,10 @@ const mapToCssModules = (className = '', cssModule = globalCssModule)=>{
126126
.join(' ');
127127
}
128128

129-
130129
function deprecated(propType, explanation) {
131130
return function validate(props, propName, componentName, ...rest) {
132131
if (props[propName] !== null && typeof props[propName] !== 'undefined') {
133-
warnOnce(
132+
console.error(
134133
`"${propName}" property of "${componentName}" has been deprecated.\n${explanation}`
135134
)
136135
}

0 commit comments

Comments
 (0)