# Common Config Templates
## .gitignore (Node.js)
```
node_modules/
dist/
.env
.env.local
*.log
.DS_Store
coverage/
.nyc_output/
```
## .gitignore (Python)
```
__pycache__/
*.py[cod]
*$py.class
.env
.venv/
venv/
*.egg-info/
dist/
build/
.pytest_cache/
.coverage
```
## .editorconfig
```ini
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
indent_size = 4
[*.md]
trim_trailing_whitespace = false
```
## tsconfig.json
```json
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "./dist",
"rootDir": "./src",
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
```
## eslint.config.js (ESLint 9+)
```javascript
import js from "@eslint/js";
import typescript from "@typescript-eslint/eslint-plugin";
export default [
js.configs.recommended,
{
files: ["**/*.ts"],
plugins: { "@typescript-eslint": typescript },
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
},
},
];
```
## Dockerfile (Node.js)
```dockerfile
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package*.json ./
RUN npm ci --production
EXPOSE 3000
CMD ["node", "dist/index.js"]
```
## docker-compose.yml
```yaml
version: "3.8"
services:
app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=production
env_file:
- .env
```
## GitHub Actions CI
```yaml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- run: npm ci
- run: npm run build
- run: npm test
```