File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ export const login = {
9494 let enforcedOrgs = [ ]
9595
9696 if ( enforcedChoices . length > 1 ) {
97+ /**
98+ * @type { {id: string} }
99+ */
97100 const { id } = await prompts ( {
98101 type : 'select' ,
99102 name : 'id' ,
@@ -107,6 +110,9 @@ export const login = {
107110 } )
108111 if ( id ) enforcedOrgs = [ id ]
109112 } else if ( enforcedChoices . length ) {
113+ /**
114+ * @type { {confirmOrg: boolean} }
115+ */
110116 const { confirmOrg } = await prompts ( {
111117 type : 'confirm' ,
112118 name : 'confirmOrg' ,
@@ -115,7 +121,10 @@ export const login = {
115121 onState : promptAbortHandler
116122 } )
117123 if ( confirmOrg ) {
118- enforcedOrgs = [ enforcedChoices [ 0 ] ?. value ]
124+ const existing = /** @type {undefined | {value: string} } */ ( enforcedChoices [ 0 ] )
125+ if ( existing ) {
126+ enforcedOrgs = [ existing . value ]
127+ }
119128 }
120129 }
121130 // MUST DO all updateSetting ON SAME TICK TO AVOID PARTIAL WRITE
Original file line number Diff line number Diff line change @@ -108,9 +108,15 @@ module.exports = {
108108 * @returns {(context: {package: {name: string, version: string}, issue: {type: string}}) => RuleActionUX }
109109 */
110110 createIssueUXLookup ( settings ) {
111+ /**
112+ * @type {Map<keyof (typeof settings.defaults.issueRules), RuleActionUX> }
113+ */
111114 const cachedUX = new Map ( )
112115 return ( context ) => {
113116 const key = context . issue . type
117+ /**
118+ * @type {RuleActionUX | undefined }
119+ */
114120 let ux = cachedUX . get ( key )
115121 if ( ux ) {
116122 return ux
Original file line number Diff line number Diff line change 44 " cli.js"
55 ],
66 "include" : [
7+ " lib/utils/issue-rules.cjs" ,
78 " lib/**/*" ,
89 " test/**/*"
910 ],
You can’t perform that action at this time.
0 commit comments