Skip to content

Commit 8379dad

Browse files
committed
Merge pull request react-bootstrap#1021 from AlexKVal/eslintMisc
Eslint misc cleanup
2 parents 30fe823 + 86d3feb commit 8379dad

10 files changed

Lines changed: 14 additions & 10 deletions

File tree

src/Collapse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let capitalize = str => str[0].toUpperCase() + str.substr(1);
77

88
// reading a dimension prop will cause the browser to recalculate,
99
// which will let our animations work
10-
let triggerBrowserReflow = node => node.offsetHeight; //eslint-disable-line no-unused-expressions
10+
let triggerBrowserReflow = node => node.offsetHeight;
1111

1212
const MARGINS = {
1313
height: ['marginTop', 'marginBottom'],

src/Input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import deprecationWarning from './utils/deprecationWarning';
55

66
class Input extends InputBase {
77
render() {
8-
if (this.props.type === 'static') { // eslint-disable-line react/prop-types
8+
if (this.props.type === 'static') {
99
deprecationWarning('Input type=static', 'StaticText');
1010
return <FormControls.Static {...this.props} />;
1111
}

src/ModalHeader.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class ModalHeader extends React.Component {
1313
{ this.props.closeButton &&
1414
<button
1515
className='close'
16-
aria-label={this.props['aria-label'] || 'Close'} //eslint-disable-line react/prop-types
1716
onClick={this.props.onHide}
1817
>
1918
<span aria-hidden="true">
@@ -31,6 +30,11 @@ class ModalHeader extends React.Component {
3130
ModalHeader.__isModalHeader = true;
3231

3332
ModalHeader.propTypes = {
33+
/**
34+
* The 'aria-label' attribute is used to define a string that labels the current element.
35+
* It is used for Assistive Technology when the label text is not visible on screen.
36+
*/
37+
'aria-label': React.PropTypes.string,
3438
/**
3539
* A css class applied to the Component
3640
*/
@@ -47,6 +51,7 @@ ModalHeader.propTypes = {
4751
};
4852

4953
ModalHeader.defaultProps = {
54+
'aria-label': 'Close',
5055
modalClassName: 'modal-header',
5156
closeButton: false
5257
};

src/NavItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const NavItem = React.createClass({
2929
title,
3030
target,
3131
children,
32-
'aria-controls': ariaControls, // eslint-disable-line react/prop-types
32+
'aria-controls': ariaControls,
3333
...props } = this.props;
3434
let classes = {
3535
active,

src/Overlay.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/*eslint-disable object-shorthand, react/prop-types */
1+
/* eslint react/prop-types: [2, {ignore: ["container", "containerPadding", "target", "placement", "children"] }] */
2+
/* These properties are validated in 'Portal' and 'Position' components */
3+
24
import React, { cloneElement } from 'react';
35
import Portal from './Portal';
46
import Position from './Position';

src/PaginationButton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const PaginationButton = React.createClass({
4141

4242
let {
4343
className,
44-
...anchorProps // eslint-disable-line object-shorthand
44+
...anchorProps
4545
} = this.props;
4646

4747
return (

src/Popover.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/no-multi-comp */
21
import React from 'react';
32
import classNames from 'classnames';
43
import BootstrapMixin from './BootstrapMixin';

src/Portal.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/*eslint-disable react/prop-types */
21
import React from 'react';
32
import CustomPropTypes from './utils/CustomPropTypes';
43
import domUtils from './utils/domUtils';

src/Tooltip.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/no-multi-comp */
21
import React from 'react';
32
import classNames from 'classnames';
43
import BootstrapMixin from './BootstrapMixin';

src/utils/overlayPositionUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const utils = {
2525
domUtils.getOffset(target) : domUtils.getPosition(target, container);
2626

2727
return {
28-
...offset, // eslint-disable-line object-shorthand
28+
...offset,
2929
height: target.offsetHeight,
3030
width: target.offsetWidth
3131
};

0 commit comments

Comments
 (0)