@@ -150,10 +150,10 @@ const vscode = {
150150 }
151151 } ,
152152 window : {
153- showInformationMessage : ( msg ) => console . log ( `Info: ${ msg } ` ) ,
153+ showInformationMessage : msg => console . log ( `Info: ${ msg } ` ) ,
154154 activeTextEditor : {
155155 document : { getText : ( ) => 'mock text' } ,
156- edit : ( editBuilder ) => { }
156+ edit : editBuilder => { }
157157 }
158158 }
159159} ;
@@ -172,6 +172,7 @@ vscode.commands.registerCommand('indonesian-formalizer.formalizeSelection', () =
172172 editBuilder . replace ( selection , formal ) ;
173173 } ) ;
174174
175+ // eslint-disable-next-line no-undef
175176 vscode . window . showInformationMessage ( `Text formalized! Score: ${ analysis . score } %` ) ;
176177} ) ;
177178
@@ -198,7 +199,7 @@ const FormalizerComponent = () => {
198199 React . createElement ( 'h2' , null , '🇮🇩 Indonesian Text Formalizer' ) ,
199200 React . createElement ( 'textarea' , {
200201 value : text ,
201- onChange : ( e ) => setText ( e . target . value ) ,
202+ onChange : e => setText ( e . target . value ) ,
202203 placeholder : 'Ketik teks informal di sini...'
203204 } ) ,
204205 React . createElement ( 'button' , { onClick : handleFormalize } , 'Formalize' ) ,
@@ -232,13 +233,13 @@ function formalizeGitCommit() {
232233 output : process . stdout
233234 } ) ;
234235
235- readline . question ( 'Commit message (informal): ' , ( casualMessage ) => {
236+ readline . question ( 'Commit message (informal): ' , casualMessage => {
236237 const formalMessage = formalizer . formalize ( casualMessage ) ;
237238
238239 console . log ( `\nOriginal: ${ casualMessage } ` ) ;
239240 console . log ( `Formal: ${ formalMessage } ` ) ;
240241
241- readline . question ( '\nUse formal version? (y/n): ' , ( answer ) => {
242+ readline . question ( '\nUse formal version? (y/n): ' , answer => {
242243 const message = answer . toLowerCase ( ) === 'y' ? formalMessage : casualMessage ;
243244
244245 try {
@@ -271,6 +272,7 @@ async function handleSlackMessage(event) {
271272 type : 'section' ,
272273 text : {
273274 type : 'mrkdwn' ,
275+ // eslint-disable-next-line max-len
274276 text : `*Original:* ${ text } \n*Formal:* ${ formal } \n*Formality Score:* ${ analysis . score } % (${ analysis . level } )`
275277 }
276278 }
@@ -289,10 +291,12 @@ async function handleSlackMessage(event) {
289291const browserExtension = {
290292 // Fungsi untuk browser extension
291293 formalizeTextarea : function ( ) {
294+ // eslint-disable-next-line no-undef
292295 const textareas = document . querySelectorAll ( 'textarea' ) ;
293296
294297 textareas . forEach ( textarea => {
295298 // Add formalize button
299+ // eslint-disable-next-line no-undef
296300 const button = document . createElement ( 'button' ) ;
297301 button . textContent = 'Formalize' ;
298302 button . style . cssText = 'position: absolute; right: 5px; top: 5px; z-index: 1000;' ;
@@ -301,13 +305,15 @@ const browserExtension = {
301305 const formalizer = new IndonesianFormalizer ( ) ;
302306 const formal = formalizer . formalize ( textarea . value ) ;
303307
308+ // eslint-disable-next-line max-len, no-undef
304309 if ( confirm ( `Replace with formal version?\n\nOriginal: ${ textarea . value } \n\nFormal: ${ formal } ` ) ) {
305310 textarea . value = formal ;
306311 textarea . dispatchEvent ( new Event ( 'input' , { bubbles : true } ) ) ;
307312 }
308313 } ) ;
309314
310315 // Position button relative to textarea
316+ // eslint-disable-next-line no-undef
311317 const wrapper = document . createElement ( 'div' ) ;
312318 wrapper . style . position = 'relative' ;
313319 textarea . parentNode . insertBefore ( wrapper , textarea ) ;
@@ -337,7 +343,7 @@ _Skor formalitas: ${analysis.score}% (${analysis.level})_
337343 ` ;
338344
339345 // Send response via WhatsApp API
340- await sendWhatsAppMessage ( from , response ) ;
346+ await handleWhatsAppMessage ( from , response ) ;
341347 }
342348}
343349
0 commit comments