From e6c92a24eddde6578cde263bb09df8d60bba4b92 Mon Sep 17 00:00:00 2001 From: Toni Alatalo Date: Tue, 26 Aug 2025 19:59:05 +0300 Subject: [PATCH] Prompts: align examples to TypeScript (.tsx/.ts) to avoid .jsx drift (#1076) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prompt text says: > - Use TypeScript. But in the examples there are .jsx files. I got errors sometimes (in my fork with other changes too) that JSX got generated instead of TSX. This seems to have fixed it for me. --- ## Summary by cubic Updated system prompt examples to use .tsx/.ts instead of .jsx/.js, matching the “Use TypeScript” instruction. This prevents JSX drift and reduces cases where generated code uses JSX instead of TSX. --- src/prompts/system_prompt.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/prompts/system_prompt.ts b/src/prompts/system_prompt.ts index 8599636..73a5e84 100644 --- a/src/prompts/system_prompt.ts +++ b/src/prompts/system_prompt.ts @@ -22,9 +22,9 @@ Example of proper thinking structure for a debugging request: - This appears to be a **functional issue**, not just styling • **Examine relevant components in the codebase** - - Form component at \`src/components/ContactForm.jsx\` - - Button component at \`src/components/Button.jsx\` - - Form submission logic in \`src/utils/formHandlers.js\` + - Form component at \`src/components/ContactForm.tsx\` + - Button component at \`src/components/Button.tsx\` + - Form submission logic in \`src/utils/formHandlers.ts\` - **Key observation**: onClick handler in Button component doesn't appear to be triggered • **Diagnose potential causes** @@ -109,7 +109,7 @@ Do not leave any import unresolved. ## Example 1: Adding a new component - + "use client"; import React from 'react'; @@ -136,7 +136,7 @@ const Button = ({ children, variant = 'primary', onClick, disabled = false }) => export default Button; - + "use client"; import React from 'react'; @@ -181,7 +181,7 @@ OK, I've installed the package. Now, I want to create a ToastProvider component. ### System response - + "use client"; import React from 'react'; @@ -190,7 +190,7 @@ const ToastProvider = () => { }; export default ToastProvider; - + "use client"; import React from 'react'; @@ -207,7 +207,7 @@ ReactDOM.createRoot(document.getElementById('root')).render( ); - + "use client"; import toast from 'react-hot-toast'; @@ -229,9 +229,9 @@ I've added a toast notification system using react-hot-toast, created a ToastPro ## Example 3: Renaming and deleting files - + - + "use client"; import React from 'react'; @@ -264,9 +264,9 @@ const ProfileCard = ({ user }) => { export default ProfileCard; - + - + "use client"; import React from 'react';