@@ -10,17 +10,17 @@ const { socketYmlSchemaV1 } = require('./lib/v1')
1010
1111/**
1212 * @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
1616 */
1717
1818/**
1919 * @typedef SocketYml
2020 * @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
2424 */
2525
2626/** @type {import('ajv').JSONSchemaType<SocketYml> } */
@@ -32,24 +32,24 @@ const socketYmlSchema = {
3232 projectIgnorePaths : {
3333 type : 'array' ,
3434 items : { type : 'string' } ,
35- nullable : true
35+ default : [ ]
3636 } ,
3737 issueRules : {
3838 type : 'object' ,
39- nullable : true ,
4039 required : [ ] ,
41- additionalProperties : { type : 'boolean' }
40+ additionalProperties : { type : 'boolean' } ,
41+ default : { }
4242 } ,
4343 githubApp : {
4444 type : 'object' ,
45- nullable : true ,
4645 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 } ,
5049 } ,
5150 required : [ ] ,
5251 additionalProperties : false ,
52+ default : { enabled : true , projectReportsEnabled : true , pullRequestAlertsEnabled : true }
5353 } ,
5454 } ,
5555 required : [ 'version' ] ,
@@ -180,9 +180,9 @@ async function parseV1SocketConfig (parsedV1Content) {
180180 projectIgnorePaths : parsedV1Content ?. ignore ?? [ ] ,
181181 issueRules : parsedV1Content ?. issues ?? { } ,
182182 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 )
186186 }
187187 }
188188 return v2
0 commit comments