File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 140
140
// When we have no example context, parse errors are common because
141
141
// there are missing variables in the js, thus we ignore them.
142
142
$ ignoreparseerrors = empty ($ example ) ? true : false ;
143
+ print_message ('INFO ' , 'ESLint reported JavaScript errors ' );
143
144
print_eslint_problems ($ eslintproblems , $ ignoreparseerrors );
144
145
}
145
146
@@ -260,8 +261,18 @@ function print_eslint_problems($problems, $ignoreparseerrors) {
260
261
} else {
261
262
$ severity = 'warning ' ;
262
263
}
263
- $ message = "ESLint {$ severity } [ {$ problem ->ruleId }]: {$ problem ->message } ( {$ problem ->source } ), Line: {$ problem ->line } Column: {$ problem ->column }" ;
264
- print_problem ('WARNING ' , $ message );
264
+ if ($ problem ->linesource ) {
265
+ $ message = "ESLint {$ severity } [ {$ problem ->ruleId }]: {$ problem ->message }, Line: {$ problem ->line } Column: {$ problem ->column }" ;
266
+ print_problem ('WARNING ' , $ message );
267
+ print_problem ('WARNING ' , rtrim ($ problem ->linesource ));
268
+
269
+ if ($ problem ->column !== null ) {
270
+ print_problem ('WARNING ' , str_pad (' ' , $ problem ->column - 1 ) . '^ ' );
271
+ }
272
+ } else {
273
+ $ message = "ESLint {$ severity } [ {$ problem ->ruleId }]: {$ problem ->message } ( {$ problem ->source } ), Line: {$ problem ->line } Column: {$ problem ->column }" ;
274
+ print_problem ('WARNING ' , $ message );
275
+ }
265
276
}
266
277
}
267
278
You can’t perform that action at this time.
0 commit comments