Skip to content

Commit 033c170

Browse files
committed
fixes #9
1 parent 877d3ee commit 033c170

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

es5.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module.exports = {
4242
// --------------------------------------------
4343

4444
'guard-for-in': 'error',
45+
'max-nested-callbacks': ['error', {max: 3}],
4546
'no-caller': 'error',
4647
'no-extend-native': 'error',
4748
'no-extra-bind': 'error',

test/es5/max-nested-callbacks.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict';
2+
3+
var bar = function (callback) {
4+
foo(callback);
5+
};
6+
7+
var foo = function (callback) {
8+
bar(callback);
9+
};
10+
11+
bar(function () {
12+
foo(function () {
13+
bar(function () {
14+
// maximum
15+
});
16+
});
17+
});

test/es6/max-nested-callbacks.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const bar = (callback) => {
2+
foo(callback);
3+
};
4+
5+
const foo = (callback) => {
6+
bar(callback);
7+
};
8+
9+
bar(() => {
10+
foo(() => {
11+
bar(() => {
12+
// maximum
13+
});
14+
});
15+
});

0 commit comments

Comments
 (0)