@@ -85,13 +85,13 @@ export function lintOutput(json: CR.Output): void {
8585
8686 if ( warningKeys . length > 0 ) {
8787 warningKeys . forEach ( ( w ) => {
88- console . log ( yellow ( `Warning : ${ w . warning } : ` , w . location ) ) ;
88+ console . log ( yellow ( `\nWarning : ${ w . warning } : ` , w . location ) ) ;
8989 } ) ;
9090 }
9191
9292 if ( invalidKeys . length > 0 ) {
9393 invalidKeys . forEach ( ( e ) => {
94- console . log ( red ( `Error : ${ e . error } : ` , e . location ) ) ;
94+ console . log ( red ( `\nError : ${ e . error } : ` , e . location ) ) ;
9595 } ) ;
9696
9797 process . exit ( 1 ) ; // fail
@@ -102,9 +102,7 @@ export function isValidJSON(text: string): void {
102102 if ( ! / ^ [ \] , : { } \s ] * $ / . test ( text . replace ( / \\ [ " \\ \/ b f n r t u ] / g, '@' ) .
103103 replace ( / " [ ^ " \\ \n \r ] * " | t r u e | f a l s e | n u l l | - ? \d + (?: \. \d * ) ? (?: [ e E ] [ + \- ] ? \d + ) ? / g, ']' ) .
104104 replace ( / (?: ^ | : | , ) (?: \s * \[ ) + / g, '' ) ) ) {
105- console . log ( red ( `
106- Something went wrong. Build did not output valid JSON.
107- ` ) ) ;
105+ console . log ( red ( '\nSomething went wrong. Build did not output valid JSON.' ) ) ;
108106 process . exit ( 1 ) ; // fail
109107 }
110108}
@@ -113,18 +111,14 @@ export function hasTutorialInfo(json: CR.Output): void {
113111 let validTitle = json . info . title . length > 0 ,
114112 validDescription = json . info . description . length > 0 ;
115113 if ( ! ( validTitle && validDescription ) ) {
116- console . log ( red ( `
117- Your tutorial is missing basic project information. Check the project title & description.
118- ` ) ) ;
114+ console . log ( red ( '\nYour tutorial is missing basic project information. Check the project title & description.' ) ) ;
119115 process . exit ( 1 ) ; // fail
120116 }
121117}
122118
123119export function hasPage ( json : CR . Output ) : void {
124120 if ( ! ( json . chapters [ 0 ] . pages . length > 0 && ! ! json . chapters [ 0 ] . pages [ 0 ] . title ) ) {
125- console . log ( red ( `
126- Your tutorial requires at least one page.
127- ` ) ) ;
121+ console . log ( red ( '\nYour tutorial requires at least one page.' ) ) ;
128122 process . exit ( 1 ) ; // fail
129123 }
130124}
0 commit comments