@@ -21,16 +21,16 @@ const defaultFormatters = [
2121
2222class FriendlyErrorsWebpackPlugin {
2323
24- constructor ( options ) {
25- options = options || { } ;
26- this . compilationSuccessInfo = options . compilationSuccessInfo || { } ;
24+ constructor ( options ) {
25+ options = options || { } ;
26+ this . compilationSuccessInfo = options . compilationSuccessInfo || { } ;
2727 this . onErrors = options . onErrors ;
2828 this . shouldClearConsole = options . clearConsole || true ;
2929 this . formatters = concat ( defaultFormatters , options . additionalFormatters ) ;
3030 this . transformers = concat ( defaultTransformers , options . additionalTransformers ) ;
3131 }
3232
33- apply ( compiler ) {
33+ apply ( compiler ) {
3434
3535 compiler . plugin ( 'done' , stats => {
3636 this . clearConsole ( ) ;
@@ -79,25 +79,26 @@ class FriendlyErrorsWebpackPlugin {
7979 }
8080
8181 displayErrors ( errors , severity ) {
82-
8382 const processedErrors = transformErrors ( errors , this . transformers ) ;
8483
8584 const topErrors = getMaxSeverityErrors ( processedErrors ) ;
8685 const nbErrors = topErrors . length ;
8786
88- const subtitle = severity === 'error' ? `Failed to compile with ${ nbErrors } ${ severity } s` : `Compiled with ${ nbErrors } ${ severity } s` ;
87+ const subtitle = severity === 'error' ?
88+ `Failed to compile with ${ nbErrors } ${ severity } s` :
89+ `Compiled with ${ nbErrors } ${ severity } s` ;
8990 output . title ( severity , severity . toUpperCase ( ) , subtitle ) ;
9091
9192 if ( this . onErrors ) {
9293 this . onErrors ( severity , topErrors ) ;
9394 }
9495
9596 formatErrors ( topErrors , this . formatters , severity )
96- . forEach ( ( chunk ) => output . log ( chunk ) ) ;
97+ . forEach ( chunk => output . log ( chunk ) ) ;
9798 }
9899}
99100
100- function getMaxSeverityErrors ( errors ) {
101+ function getMaxSeverityErrors ( errors ) {
101102 const maxSeverity = getMaxInt ( errors , 'severity' ) ;
102103 return errors . filter ( e => e . severity === maxSeverity ) ;
103104}
@@ -109,9 +110,3 @@ function getMaxInt(collection, propertyName) {
109110}
110111
111112module . exports = FriendlyErrorsWebpackPlugin ;
112-
113- function displayCompilationMessage ( message , color ) {
114- output . log ( ) ;
115- output . log ( chalk [ color ] ( message ) ) ;
116- output . log ( ) ;
117- }
0 commit comments