File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -80,9 +80,9 @@ var issues = {
8080 var severityMap = config . interpret ( codes , options . config ) ;
8181
8282 // organize by severity
83- for ( var key in categorized ) {
84- issue = categorized [ key ] ;
85- issue . code = key ;
83+ for ( var code in categorized ) {
84+ issue = categorized [ code ] ;
85+ issue . code = code ;
8686
8787 if ( severityMap . hasOwnProperty ( issue . code ) ) {
8888 issue . severity = severityMap [ issue . code ] ;
@@ -93,7 +93,13 @@ var issues = {
9393 }
9494
9595 if ( issue . severity === 'error' ) {
96- errors . push ( issue ) ;
96+ // Schema validation issues will yield the JSON file invalid, we should display them first to attract
97+ // user attention.
98+ if ( code == 55 ) {
99+ errors . unshift ( issue ) ;
100+ } else {
101+ errors . push ( issue ) ;
102+ }
97103 } else if ( issue . severity === 'warning' && ! options . ignoreWarnings ) {
98104 warnings . push ( issue ) ;
99105 } else if ( issue . severity === 'ignore' ) {
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ module.exports = {
280280 55 : {
281281 key : 'JSON_SCHEMA_VALIDATION_ERROR' ,
282282 severity : 'error' ,
283- reason : 'JSON file is not formatted according the schema.'
283+ reason : 'Invalid JSON file. The file is not formatted according the schema.'
284284 } ,
285285 56 : {
286286 key : 'Participants age 89 or higher' ,
Original file line number Diff line number Diff line change 3333 "TaskName" : {
3434 "type" : " string"
3535 }
36- },
37- "required" : [
38- " TaskName" ,
39- " RepetitionTime"
40- ]
41-
36+ }
4237}
You can’t perform that action at this time.
0 commit comments