Skip to content

Commit f434323

Browse files
koba04teppeis
authored andcommitted
feat: allow jQuery Deferred for new-cap (#80)
1 parent 05422fe commit f434323

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ module.exports = {
213213
"max-nested-callbacks": ["warn", 5],
214214
"max-params": ["warn", 7],
215215
"max-statements": ["warn", 40],
216-
"new-cap": "warn",
216+
"new-cap": ["warn", { capIsNewExceptions: ["Deferred"] }],
217217
"no-array-constructor": "warn",
218218
"no-lonely-if": "warn",
219219
"no-multiple-empty-lines": [

test/fixtures/base/ok.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-env jquery */
2+
13
const foos = [''];
24
foos.map((foo) => foo + foo);
35

@@ -6,4 +8,7 @@ async function hoge() {
68
const result = await new Promise((resolve) => resolve());
79
return result;
810
}
9-
hoge();
11+
hoge();
12+
13+
$.Deferred();
14+
jQuery.Deferred();

0 commit comments

Comments
 (0)