@@ -55,11 +55,9 @@ export default class QuickAdd extends Plugin {
55
55
return this . settings . devMode ;
56
56
}
57
57
58
- const id : string = this . manifest . id ,
59
- plugins = this . app . plugins ;
60
- void plugins
61
- . disablePlugin ( id )
62
- . then ( ( ) => plugins . enablePlugin ( id ) ) ;
58
+ const id : string = this . manifest . id ;
59
+ const plugins = this . app . plugins ;
60
+ void plugins . disablePlugin ( id ) . then ( ( ) => plugins . enablePlugin ( id ) ) ;
63
61
} ,
64
62
} ) ;
65
63
@@ -71,7 +69,7 @@ export default class QuickAdd extends Plugin {
71
69
return this . settings . devMode ;
72
70
}
73
71
74
- console . log ( ` Test QuickAdd (dev)` ) ;
72
+ console . log ( " Test QuickAdd (dev)" ) ;
75
73
76
74
const fn = ( ) => {
77
75
new InfiniteAIAssistantCommandSettingsModal ( {
@@ -100,16 +98,16 @@ export default class QuickAdd extends Plugin {
100
98
ChoiceSuggester . Open ( this , this . settings . choices ) ;
101
99
} ) ;
102
100
}
103
-
101
+
104
102
this . addSettingTab ( new QuickAddSettingsTab ( this . app , this ) ) ;
105
103
106
104
this . app . workspace . onLayoutReady ( ( ) =>
107
105
new StartupMacroEngine (
108
106
this . app ,
109
107
this ,
110
108
this . settings . macros ,
111
- new ChoiceExecutor ( this . app , this )
112
- ) . run ( )
109
+ new ChoiceExecutor ( this . app , this ) ,
110
+ ) . run ( ) ,
113
111
) ;
114
112
this . addCommandsForChoices ( this . settings . choices ) ;
115
113
@@ -124,19 +122,17 @@ export default class QuickAdd extends Plugin {
124
122
125
123
async loadSettings ( ) {
126
124
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
127
- this . settings = Object . assign (
128
- { } ,
129
- DEFAULT_SETTINGS ,
130
- await this . loadData ( )
131
- ) ;
125
+ this . settings = Object . assign ( { } , DEFAULT_SETTINGS , await this . loadData ( ) ) ;
132
126
}
133
127
134
128
async saveSettings ( ) {
135
129
await this . saveData ( this . settings ) ;
136
130
}
137
131
138
132
private addCommandsForChoices ( choices : IChoice [ ] ) {
139
- choices . forEach ( ( choice ) => this . addCommandForChoice ( choice ) ) ;
133
+ for ( const choice of choices ) {
134
+ this . addCommandForChoice ( choice ) ;
135
+ }
140
136
}
141
137
142
138
public addCommandForChoice ( choice : IChoice ) {
@@ -178,7 +174,7 @@ export default class QuickAdd extends Plugin {
178
174
private getChoice (
179
175
by : "name" | "id" ,
180
176
targetPropertyValue : string ,
181
- choices : IChoice [ ] = this . settings . choices
177
+ choices : IChoice [ ] = this . settings . choices ,
182
178
) : IChoice | null {
183
179
for ( const choice of choices ) {
184
180
if ( choice [ by ] === targetPropertyValue ) {
@@ -188,7 +184,7 @@ export default class QuickAdd extends Plugin {
188
184
const subChoice = this . getChoice (
189
185
by ,
190
186
targetPropertyValue ,
191
- ( choice as IMultiChoice ) . choices
187
+ ( choice as IMultiChoice ) . choices ,
192
188
) ;
193
189
if ( subChoice ) {
194
190
return subChoice ;
@@ -208,9 +204,7 @@ export default class QuickAdd extends Plugin {
208
204
209
205
return this . app . vault
210
206
. getFiles ( )
211
- . filter ( ( file ) =>
212
- file . path . startsWith ( this . settings . templateFolderPath )
213
- ) ;
207
+ . filter ( ( file ) => file . path . startsWith ( this . settings . templateFolderPath ) ) ;
214
208
}
215
209
216
210
private announceUpdate ( ) {
0 commit comments