{ "Console Log Object": { "prefix": "clo", "body": [ "console.log('$1:', JSON.stringify($1, null, 2));" ], "description": "Log object with proper formatting" }, "React Function Component": { "prefix": "rfc", "body": [ "import React from 'react'", "", "interface ${1:${TM_FILENAME_BASE}}Props {", " $2", "}", "", "export const ${1:${TM_FILENAME_BASE}} = ({ $3 }: ${1:${TM_FILENAME_BASE}}Props) => {", " return (", "
", " $4", "
", " )", "}", "" ], "description": "React Functional Component with TypeScript" }, "Try Catch Block": { "prefix": "trc", "body": [ "try {", " $1", "} catch (error) {", " console.error('Error in ${2:function}:', error);", " $3", "}" ], "description": "Try-catch block with error logging" }, "API Endpoint": { "prefix": "api", "body": [ "async function ${1:functionName}(${2:params}) {", " try {", " const response = await fetch('${3:url}', {", " method: '${4|GET,POST,PUT,DELETE|}',", " headers: {", " 'Content-Type': 'application/json',", " },", " body: JSON.stringify(${5:data})", " });", " ", " if (!response.ok) {", " throw new Error(`HTTP error! status: ${response.status}`);", " }", " ", " const data = await response.json();", " return data;", " } catch (error) {", " console.error('Error in ${1:functionName}:', error);", " throw error;", " }", "}" ], "description": "API endpoint with error handling" } }