@@ -10,17 +10,17 @@ const { socketYmlSchemaV1 } = require('./lib/v1')
10
10
11
11
/**
12
12
* @typedef SocketYmlGitHub
13
- * @property {boolean } [ enabled] enable/disable the Socket.dev GitHub app entirely
14
- * @property {boolean } [ projectReportsEnabled] enable/disable Github app project report checks
15
- * @property {boolean } [ pullRequestAlertsEnabled] enable/disable GitHub app pull request alert checks
13
+ * @property {boolean } enabled enable/disable the Socket.dev GitHub app entirely
14
+ * @property {boolean } projectReportsEnabled enable/disable Github app project report checks
15
+ * @property {boolean } pullRequestAlertsEnabled enable/disable GitHub app pull request alert checks
16
16
*/
17
17
18
18
/**
19
19
* @typedef SocketYml
20
20
* @property {2 } version
21
- * @property {string[] } [ projectIgnorePaths]
22
- * @property {{ [issueName: string]: boolean } } [ issueRules]
23
- * @property {SocketYmlGitHub } [ githubApp]
21
+ * @property {string[] } projectIgnorePaths
22
+ * @property {{ [issueName: string]: boolean } } issueRules
23
+ * @property {SocketYmlGitHub } githubApp
24
24
*/
25
25
26
26
/** @type {import('ajv').JSONSchemaType<SocketYml> } */
@@ -32,24 +32,24 @@ const socketYmlSchema = {
32
32
projectIgnorePaths : {
33
33
type : 'array' ,
34
34
items : { type : 'string' } ,
35
- nullable : true
35
+ default : [ ]
36
36
} ,
37
37
issueRules : {
38
38
type : 'object' ,
39
- nullable : true ,
40
39
required : [ ] ,
41
- additionalProperties : { type : 'boolean' }
40
+ additionalProperties : { type : 'boolean' } ,
41
+ default : { }
42
42
} ,
43
43
githubApp : {
44
44
type : 'object' ,
45
- nullable : true ,
46
45
properties : {
47
- enabled : { type : 'boolean' , nullable : true , default : true } ,
48
- projectReportsEnabled : { type : 'boolean' , nullable : true , default : true } ,
49
- pullRequestAlertsEnabled : { type : 'boolean' , nullable : true , default : true } ,
46
+ enabled : { type : 'boolean' , default : true } ,
47
+ projectReportsEnabled : { type : 'boolean' , default : true } ,
48
+ pullRequestAlertsEnabled : { type : 'boolean' , default : true } ,
50
49
} ,
51
50
required : [ ] ,
52
51
additionalProperties : false ,
52
+ default : { enabled : true , projectReportsEnabled : true , pullRequestAlertsEnabled : true }
53
53
} ,
54
54
} ,
55
55
required : [ 'version' ] ,
@@ -180,9 +180,9 @@ async function parseV1SocketConfig (parsedV1Content) {
180
180
projectIgnorePaths : parsedV1Content ?. ignore ?? [ ] ,
181
181
issueRules : parsedV1Content ?. issues ?? { } ,
182
182
githubApp : {
183
- enabled : parsedV1Content ?. enabled ,
184
- pullRequestAlertsEnabled : parsedV1Content ?. pullRequestAlertsEnabled ,
185
- projectReportsEnabled : parsedV1Content ?. projectReportsEnabled
183
+ enabled : Boolean ( parsedV1Content ?. enabled ) ,
184
+ pullRequestAlertsEnabled : Boolean ( parsedV1Content ?. pullRequestAlertsEnabled ) ,
185
+ projectReportsEnabled : Boolean ( parsedV1Content ?. projectReportsEnabled )
186
186
}
187
187
}
188
188
return v2
0 commit comments