File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 77
88'use strict' ;
99
10+ const path = require ( 'path' ) ;
1011const chalk = require ( 'chalk' ) ;
1112const stripAnsi = require ( 'strip-ansi' ) ;
1213const table = require ( 'text-table' ) ;
1314
15+ const cwd = process . cwd ( ) ;
16+
1417function isError ( message ) {
1518 if ( message . fatal || message . severity === 2 ) {
1619 return true ;
1720 }
1821 return false ;
1922}
2023
24+ function getRelativePath ( filePath ) {
25+ return path . relative ( cwd , filePath ) ;
26+ }
27+
2128function formatter ( results ) {
2229 let output = '\n' ;
2330 let hasErrors = false ;
@@ -73,6 +80,10 @@ function formatter(results) {
7380 } ,
7481 } ) ;
7582
83+ // print the filename and relative path
84+ output += `${ getRelativePath ( result . filePath ) } \n` ;
85+
86+ // print the errors
7687 output += `${ outputTable } \n\n` ;
7788 } ) ;
7889
You can’t perform that action at this time.
0 commit comments