@@ -7,19 +7,22 @@ import "@vscode-elements/elements/dist/vscode-button";
77import AIDisclaimer from "./AIDisclaimer" ;
88import { hosted } from "./configuration" ;
99
10+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1011function extractTextFromChildren ( children : any ) : string {
1112 if ( ! children ) return "" ;
1213
1314 return React . Children . toArray ( children ) . reduce ( ( text , child ) => {
1415 if ( typeof child === "string" ) {
1516 return text + child ;
1617 } else if ( React . isValidElement ( child ) ) {
18+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1719 return text + extractTextFromChildren ( ( child . props as any ) . children ) ;
1820 }
1921 return text ;
2022 } , "" ) as string ;
2123}
2224
25+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2326function CopyButton ( props : { children : any ; text ?: string } ) {
2427 const { children, text } = props ;
2528 const [ copied , setCopied ] = useState ( false ) ;
@@ -30,7 +33,7 @@ function CopyButton(props: { children: any; text?: string }) {
3033 await navigator . clipboard . writeText ( res ) ;
3134 setCopied ( true ) ;
3235 setTimeout ( ( ) => setCopied ( false ) , 2000 ) ;
33- } catch ( err ) { }
36+ } catch { }
3437 } ;
3538 const title = copied ? "Copied!" : "Copy" ;
3639 const buttonText = copied ? "Copied!" : "" ;
@@ -41,6 +44,7 @@ function CopyButton(props: { children: any; text?: string }) {
4144 ) ;
4245}
4346
47+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4448function SaveButton ( props : { filename ?: string ; children : any ; text ?: string } ) {
4549 const { children, text, filename } = props ;
4650 const [ saved , setSaved ] = useState ( false ) ;
@@ -64,7 +68,7 @@ function SaveButton(props: { filename?: string; children: any; text?: string })
6468 }
6569 setSaved ( true ) ;
6670 setTimeout ( ( ) => setSaved ( false ) , 2000 ) ;
67- } catch ( err ) { }
71+ } catch { }
6872 } ;
6973 const title = saved ? "Saved!" : "Save" ;
7074 return (
@@ -79,6 +83,7 @@ function SaveButton(props: { filename?: string; children: any; text?: string })
7983}
8084
8185export default function CopySaveButtons ( props : {
86+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8287 children : any ;
8388 filename ?: string ;
8489 text ?: string ;
0 commit comments