Skip to content

Commit dc669b6

Browse files
committed
Merge pull request react-bootstrap#1335 from AlexKVal/airbnb
Left `Airbnb` rules.
2 parents 350f28e + 3552723 commit dc669b6

86 files changed

Lines changed: 783 additions & 806 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@
1616
"constructor-super": 2,
1717
"comma-dangle": 0,
1818
"eqeqeq": [2, "allow-null"],
19-
"func-names": 0,
20-
"guard-for-in": 0,
2119
"one-var": [2, { "initialized": "never" }],
2220
"prefer-const": 0,
2321
"key-spacing": 0,
2422
"no-eq-null": 0,
25-
"no-else-return": 0,
2623
"no-param-reassign": 0,
2724
"no-this-before-super": 2,
2825
"no-undef": 2,

docs/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ if (development) {
2121
let webpackPort = process.env.WEBPACK_DEV_PORT;
2222
let target = `http://${ip.address()}:${webpackPort}`;
2323

24-
app.get('/assets/*', function(req, res) {
24+
app.get('/assets/*', (req, res) => {
2525
proxy.web(req, res, { target });
2626
});
2727

28-
proxy.on('error', function(e) {
28+
proxy.on('error', e => {
2929
console.log('Could not connect to webpack proxy'.red);
3030
console.log(e.toString().red);
3131
});
@@ -49,7 +49,7 @@ if (development) {
4949
app.use(express.static(path.join(__dirname, '../docs-built')));
5050
}
5151

52-
app.listen(port, function() {
52+
app.listen(port, () => {
5353
console.log(`Server started at:`);
5454
console.log(`- http://localhost:${port}`);
5555
console.log(`- http://${ip.address()}:${port}`);

docs/src/PropTable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ const PropTable = React.createClass({
174174
return 'function';
175175
} else if (typeName === 'bool') {
176176
return 'boolean';
177-
} else {
178-
return typeName;
179177
}
178+
179+
return typeName;
180180
},
181181

182182
renderEnum(enumType) {

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint no-var: 0, babel/object-shorthand: 0, vars-on-top: 0 */
1+
/* eslint no-var: 0, babel/object-shorthand: 0, vars-on-top: 0, func-names: 0 */
22
require('babel/register');
33

44
var webpackConfig = require('./webpack/test.config.js');

src/ButtonGroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const ButtonGroup = React.createClass({
1515
*/
1616
block: CustomPropTypes.all([
1717
React.PropTypes.bool,
18-
function(props) {
18+
props => {
1919
if (props.block && !props.vertical) {
2020
return new Error('The block property requires the vertical property to be set to have any effect');
2121
}

src/Carousel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ const Carousel = React.createClass({
208208
renderIndicators() {
209209
let indicators = [];
210210
ValidComponentChildren
211-
.forEach(this.props.children, function(child, index) {
211+
.forEach(this.props.children, (child, index) => {
212212
indicators.push(
213213
this.renderIndicator(child, index),
214214

@@ -233,7 +233,7 @@ const Carousel = React.createClass({
233233
this.setState({
234234
previousActiveIndex: null,
235235
direction: null
236-
}, function() {
236+
}, () => {
237237
this.waitForNext();
238238

239239
if (this.props.onSlideEnd) {

src/Col.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const Col = React.createClass({
149149
let ComponentClass = this.props.componentClass;
150150
let classes = {};
151151

152-
Object.keys(styleMaps.SIZES).forEach(function(key) {
152+
Object.keys(styleMaps.SIZES).forEach( key => {
153153
let size = styleMaps.SIZES[key];
154154
let prop = size;
155155
let classPart = size + '-';

src/CollapsibleNav.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ const CollapsibleNav = React.createClass({
4444
{ nav }
4545
</Collapse>
4646
);
47-
} else {
48-
return nav;
4947
}
48+
return nav;
5049
},
5150

5251
getChildActiveProp(child) {

src/DropdownButton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ DropdownButton.propTypes = {
4848
*/
4949
navItem: CustomPropTypes.all([
5050
React.PropTypes.bool,
51-
function(props) {
51+
props => {
5252
if (props.navItem) {
5353
deprecationWarning('navItem', 'NavDropdown component', 'https://github.com/react-bootstrap/react-bootstrap/issues/526');
5454
}

src/FadeMixin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import deprecationWarning from './utils/deprecationWarning';
66
function getElementsAndSelf(root, classes) {
77
let els = root.querySelectorAll('.' + classes.join('.'));
88

9-
els = [].map.call(els, function(e) { return e; });
9+
els = [].map.call(els, e => e );
1010

1111
for (let i = 0; i < classes.length; i++) {
1212
if ( !root.className.match(new RegExp('\\b' + classes[i] + '\\b'))) {
@@ -29,7 +29,7 @@ export default {
2929
els = getElementsAndSelf(React.findDOMNode(this), ['fade']);
3030

3131
if (els.length) {
32-
els.forEach(function(el) {
32+
els.forEach( el => {
3333
el.className += ' in';
3434
});
3535
}
@@ -40,7 +40,7 @@ export default {
4040
let els = getElementsAndSelf(this._fadeOutEl, ['fade', 'in']);
4141

4242
if (els.length) {
43-
els.forEach(function(el) {
43+
els.forEach( el => {
4444
el.className = el.className.replace(/\bin\b/, '');
4545
});
4646
}

0 commit comments

Comments
 (0)