More concise steps to create GATHUB done by GROK

# 1. Install Prettier + import sorter
npm install –save-dev \
prettier \
@ianvs/prettier-plugin-sort-imports

# 2. Create .prettierrc
cat > .prettierrc << ‘EOF’
{
“semi”: true,
“trailingComma”: “es5”,
“singleQuote”: true,
“printWidth”: 100,
“tabWidth”: 2,
“useTabs”: false,
“bracketSpacing”: true,
“arrowParens”: “avoid”,
“plugins”: [“@ianvs/prettier-plugin-sort-imports”],
“importOrder”: [“^node:”, “”, “^@/”, “^[./]”], “importOrderSeparation”: true,
“importOrderSortSpecifiers”: true
}
EOF

# 3. Create .prettierignore
cat > .prettierignore << ‘EOF’
dist/
node_modules/
*.log
.DS_Store
.vscode/
*.d.ts
*.tsbuildinfo
EOF

# 4. Add scripts to package.json (edit manually or append)
# Open package.json and make sure “scripts” includes:
“format”: “prettier –write \”src/**/*.ts\””,
“format:check”: “prettier –check \”src/**/*.ts\””

# Quick one-liner to add them (careful: overwrites existing scripts section) # Alternative: just edit package.json in VS Code / nano
jq ‘.scripts += {“format”: “prettier –write \”src/**/*.ts\””, “format:check”: “prettier –check \”src/**/*.ts\””}’ package.json > tmp.json && mv tmp.json package.json

# 5. Format all files now
npm run format

# 6. Commit the changes
git add .
git commit -m “Add Prettier config and formatting scripts”

AND THEN NEXT

{
“editor.defaultFormatter”: “esbenp.prettier-vscode”,
“editor.formatOnSave”: true,
“[typescript]”: {
“editor.defaultFormatter”: “esbenp.prettier-vscode”
}
}

Leave a comment