You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
errors: [{message: "Wrap an immediate function invocation in parentheses.",type: "CallExpression"}]
116
+
errors: [wrapInvocationError]
114
117
},
115
118
{
116
119
code: "[function(){ }()];",
117
120
output: "[(function(){ }())];",
118
-
errors: [{message: "Wrap an immediate function invocation in parentheses.",type: "CallExpression"}]
121
+
errors: [wrapInvocationError]
119
122
},
120
123
{
121
124
code: "var a = function(){ }();",
122
125
output: "var a = (function(){ }());",
123
-
errors: [{message: "Wrap an immediate function invocation in parentheses.",type: "CallExpression"}]
126
+
errors: [wrapInvocationError]
124
127
},
125
128
{
126
129
code: "(function(){ }(), 0);",
127
130
output: "((function(){ }()), 0);",
128
-
errors: [{message: "Wrap an immediate function invocation in parentheses.",type: "CallExpression"}]
131
+
errors: [wrapInvocationError]
129
132
},
130
133
{
131
134
code: "(function a(){ })();",
132
135
output: "(function a(){ }());",
133
136
options: ["outside"],
134
-
errors: [{message: "Move the invocation into the parens that contain the function.",type: "CallExpression"}]
137
+
errors: [moveInvocationError]
135
138
},
136
139
{
137
140
code: "(function a(){ }());",
138
141
output: "(function a(){ })();",
139
142
options: ["inside"],
140
-
errors: [{message: "Wrap only the function expression in parens.",type: "CallExpression"}]
143
+
errors: [wrapExpressionError]
141
144
},
142
145
{
143
146
144
147
// Ensure all comments get preserved when autofixing.
145
148
code: "( /* a */ function /* b */ foo /* c */ ( /* d */ bar /* e */ ) /* f */ { /* g */ return; /* h */ } /* i */ ( /* j */ baz /* k */) /* l */ ) /* m */ ;",
146
149
output: "( /* a */ function /* b */ foo /* c */ ( /* d */ bar /* e */ ) /* f */ { /* g */ return; /* h */ }) /* i */ ( /* j */ baz /* k */) /* l */ /* m */ ;",
147
150
options: ["inside"],
148
-
errors: [{message: "Wrap only the function expression in parens.",type: "CallExpression"}]
151
+
errors: [wrapExpressionError]
149
152
},
150
153
{
151
154
code: "( /* a */ function /* b */ foo /* c */ ( /* d */ bar /* e */ ) /* f */ { /* g */ return; /* h */ } /* i */ ) /* j */ ( /* k */ baz /* l */) /* m */ ;",
152
155
output: "( /* a */ function /* b */ foo /* c */ ( /* d */ bar /* e */ ) /* f */ { /* g */ return; /* h */ } /* i */ /* j */ ( /* k */ baz /* l */)) /* m */ ;",
153
156
options: ["outside"],
154
-
errors: [{message: "Move the invocation into the parens that contain the function.",type: "CallExpression"}]
157
+
errors: [moveInvocationError]
155
158
},
156
159
{
157
160
code: "+function(){return 1;}()",
158
161
output: "+(function(){return 1;}())",
159
162
options: ["outside"],
160
-
errors: [{message: "Wrap an immediate function invocation in parentheses.",type: "CallExpression"}]
163
+
errors: [wrapInvocationError]
161
164
},
162
165
{
163
166
code: "+function(){return 1;}()",
164
167
output: "+(function(){return 1;})()",
165
168
options: ["inside"],
166
-
errors: [{message: "Wrap an immediate function invocation in parentheses.",type: "CallExpression"}]
0 commit comments