Skip to content

Commit 4dab480

Browse files
committed
fix: wrap iife inside
1 parent e67069e commit 4dab480

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ module.exports = {
137137
'radix': 'warn',
138138
'require-await': 'error',
139139
'vars-on-top': 'off', // todo: maybe warn later
140-
'wrap-iife': 'error',
140+
'wrap-iife': ['error', 'inside'],
141141
'yoda': 'error',
142142

143143
// Strict Mode (https://eslint.org/docs/rules/#strict-mode)

test/not-ok.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ function A() {
2020

2121
new A();
2222

23+
(function f() {
24+
return 1;
25+
}());
26+
2327
// use this function to mark a variable as used
2428
function useIt(...vals) {
2529
return vals;

test/ok.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ function A() {
1717

1818
useIt(new A());
1919

20+
(function f() {
21+
return 1;
22+
})();
23+
2024
// use this function to mark a variable as used
2125
function useIt(...vals) {
2226
return vals;

test/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ assert.deepStrictEqual(errors, [
2929
'quote-props',
3030
'quotes',
3131
'strict',
32+
'wrap-iife'
3233
]);

0 commit comments

Comments
 (0)