File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -76,17 +76,17 @@ export default function linter(options, compilation) {
7676
7777 await cleanup ( ) ;
7878
79- // do not analyze if there are no results or eslint config
80- if ( ! results || results . length < 1 ) {
81- return { } ;
82- }
83-
8479 for ( const result of results ) {
8580 crossRunResultStorage [ result . filePath ] = result ;
8681 }
8782
8883 results = Object . values ( crossRunResultStorage ) ;
8984
85+ // do not analyze if there are no results or eslint config
86+ if ( ! results || results . length < 1 ) {
87+ return { } ;
88+ }
89+
9090 const formatter = await loadFormatter ( eslint , options . formatter ) ;
9191 const { errors, warnings } = formatResults (
9292 formatter ,
Original file line number Diff line number Diff line change @@ -103,7 +103,11 @@ describe('watch', () => {
103103 function finish ( err , stats ) {
104104 expect ( err ) . toBeNull ( ) ;
105105 expect ( stats . hasWarnings ( ) ) . toBe ( false ) ;
106- expect ( stats . hasErrors ( ) ) . toBe ( false ) ;
106+ const { errors } = stats . compilation ;
107+ const [ { message } ] = errors ;
108+ expect ( stats . hasErrors ( ) ) . toBe ( true ) ;
109+ expect ( message ) . toEqual ( expect . stringMatching ( 'prefer-const' ) ) ;
110+ expect ( message ) . toEqual ( expect . stringMatching ( '\\(2 errors,' ) ) ;
107111 done ( ) ;
108112 }
109113 } ) ;
You can’t perform that action at this time.
0 commit comments