Skip to content

Instantly share code, notes, and snippets.

@thesyntaxdiaries
Last active March 18, 2025 06:25
Show Gist options
  • Save thesyntaxdiaries/4e047ad917177fa5d4653288eca0cc9f to your computer and use it in GitHub Desktop.
Save thesyntaxdiaries/4e047ad917177fa5d4653288eca0cc9f to your computer and use it in GitHub Desktop.
VS Code User Settings (JSON)
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"arrowParens": "avoid"
}
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/src"
}
]
}
{
"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 (",
" <div>",
" $4",
" </div>",
" )",
"}",
""
],
"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"
}
}
# Core Extensions (Copy these commands to terminal)
code --install-extension esbenp.prettier-vscode
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens
code --install-extension aaron-bond.better-comments
code --install-extension formulahendry.auto-rename-tag
{
"type": "node",
"request": "launch",
"name": "Debug Current File",
"program": "${file}",
"skipFiles": [
"<node_internals>/**"
]
}
{
// Editor basics
"editor.fontSize": 14,
"editor.fontFamily": "FiraCode Nerd Font, Consolas, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.wordWrap": "on",
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"editor.renderWhitespace": "boundary",
"editor.linkedEditing": true,
"editor.occurrencesHighlight": true,
"editor.suggestSelection": "first",
"editor.tabSize": 2,
// Workflow improvements
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"files.autoSave": "onFocusChange",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
// Explorer settings
"explorer.compactFolders": false,
"explorer.confirmDelete": false,
"explorer.confirmDrag": false,
// Terminal setup
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.fontSize": 14,
"terminal.integrated.cursorBlinking": true,
// Git integration
"git.enableSmartCommit": true,
"git.confirmSync": false,
"git.autofetch": true,
// Language specific
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
{
// Project specific overrides
"editor.tabSize": 2,
"search.exclude": {
"**/node_modules": true,
"**/dist": true
},
// Path intellisense
"typescript.preferences.importModuleSpecifier": "relative",
// Debug configurations
"debug.javascript.autoAttachFilter": "smart",
// Project dictionary
"cSpell.words": [
"axios",
"tailwindcss",
"zustand"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment