Skip to content

Commit 117eebe

Browse files
committed
Impose 'func-names' airbnb rule
1 parent 7685370 commit 117eebe

78 files changed

Lines changed: 719 additions & 722 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"constructor-super": 2,
1717
"comma-dangle": 0,
1818
"eqeqeq": [2, "allow-null"],
19-
"func-names": 0,
2019
"guard-for-in": 0,
2120
"one-var": [2, { "initialized": "never" }],
2221
"prefer-const": 0,

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}`);

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/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
}

src/Interpolate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const Interpolate = React.createClass({
3636
delete props.unsafe;
3737

3838
if (unsafe) {
39-
let content = format.split(REGEXP).reduce(function(memo, match, index) {
39+
let content = format.split(REGEXP).reduce((memo, match, index) => {
4040
let html;
4141

4242
if (index % 2 === 0) {
@@ -59,7 +59,7 @@ const Interpolate = React.createClass({
5959

6060
return React.createElement(parent, props);
6161
} else {
62-
let kids = format.split(REGEXP).reduce(function(memo, match, index) {
62+
let kids = format.split(REGEXP).reduce((memo, match, index) => {
6363
let child;
6464

6565
if (index % 2 === 0) {

src/MenuItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ MenuItem.propTypes = {
6666
active: React.PropTypes.bool,
6767
divider: CustomPropTypes.all([
6868
React.PropTypes.bool,
69-
function(props) {
69+
props => {
7070
if (props.divider && props.children) {
7171
return new Error('Children will not be rendered for dividers');
7272
}

0 commit comments

Comments
 (0)