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 140140 // When we have no example context, parse errors are common because
141141 // there are missing variables in the js, thus we ignore them.
142142 $ ignoreparseerrors = empty ($ example ) ? true : false ;
143+ print_message ('INFO ' , 'ESLint reported JavaScript errors ' );
143144 print_eslint_problems ($ eslintproblems , $ ignoreparseerrors );
144145}
145146
@@ -260,8 +261,18 @@ function print_eslint_problems($problems, $ignoreparseerrors) {
260261 } else {
261262 $ severity = 'warning ' ;
262263 }
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+ }
265276 }
266277}
267278
You can’t perform that action at this time.
0 commit comments