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 = {
94
94
let enforcedOrgs = [ ]
95
95
96
96
if ( enforcedChoices . length > 1 ) {
97
+ /**
98
+ * @type { {id: string} }
99
+ */
97
100
const { id } = await prompts ( {
98
101
type : 'select' ,
99
102
name : 'id' ,
@@ -107,6 +110,9 @@ export const login = {
107
110
} )
108
111
if ( id ) enforcedOrgs = [ id ]
109
112
} else if ( enforcedChoices . length ) {
113
+ /**
114
+ * @type { {confirmOrg: boolean} }
115
+ */
110
116
const { confirmOrg } = await prompts ( {
111
117
type : 'confirm' ,
112
118
name : 'confirmOrg' ,
@@ -115,7 +121,10 @@ export const login = {
115
121
onState : promptAbortHandler
116
122
} )
117
123
if ( confirmOrg ) {
118
- enforcedOrgs = [ enforcedChoices [ 0 ] ?. value ]
124
+ const existing = /** @type {undefined | {value: string} } */ ( enforcedChoices [ 0 ] )
125
+ if ( existing ) {
126
+ enforcedOrgs = [ existing . value ]
127
+ }
119
128
}
120
129
}
121
130
// 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 = {
108
108
* @returns {(context: {package: {name: string, version: string}, issue: {type: string}}) => RuleActionUX }
109
109
*/
110
110
createIssueUXLookup ( settings ) {
111
+ /**
112
+ * @type {Map<keyof (typeof settings.defaults.issueRules), RuleActionUX> }
113
+ */
111
114
const cachedUX = new Map ( )
112
115
return ( context ) => {
113
116
const key = context . issue . type
117
+ /**
118
+ * @type {RuleActionUX | undefined }
119
+ */
114
120
let ux = cachedUX . get ( key )
115
121
if ( ux ) {
116
122
return ux
Original file line number Diff line number Diff line change 4
4
" cli.js"
5
5
],
6
6
"include" : [
7
+ " lib/utils/issue-rules.cjs" ,
7
8
" lib/**/*" ,
8
9
" test/**/*"
9
10
],
You can’t perform that action at this time.
0 commit comments