|
1 | | -# Code-Formatter-for-HTML-CSS-and-JS |
2 | | -A modern and improved version of Lonefy’s JS-CSS-HTML Formatter for Visual Studio Code. Updated for 2025, improved performance and configuration options. |
| 1 | +# 🧩 Code Formatter – by U:Bodigat |
| 2 | + |
| 3 | +Ein moderner, sicherer und blitzschneller Code-Formatter für **HTML, CSS, JS, JSON & SCSS**. |
| 4 | +Basierend auf [js-beautify](https://github.com/beautify-web/js-beautify) – vollständig überarbeitet mit neuem Sicherheits-Layer und sauberem TypeScript-Code. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## ✨ Features |
| 9 | + |
| 10 | +✅ Formatierung über Tastenkürzel |
| 11 | +✅ Auto-Format beim Speichern |
| 12 | +✅ Eigene lokale `formatter.json` pro Projekt |
| 13 | +✅ Unterstützung für HTML, CSS, JS, JSON & SCSS |
| 14 | +✅ Sichere JSON5-Konfiguration (keine Codeausführung) |
| 15 | +✅ Erweiterte js-beautify Defaults für moderne JS-Syntax |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## ⚙️ Verwendung |
| 20 | + |
| 21 | +**1️⃣ Manuell formatieren:** |
| 22 | +`Alt + Shift + F` oder `F1` → „Beautify Document“ |
| 23 | + |
| 24 | +**2️⃣ Automatisch beim Speichern:** |
| 25 | +Im Config-File `onSave: true` aktivieren |
| 26 | + |
| 27 | +**3️⃣ Eigene Konfiguration:** |
| 28 | +`F1` → „Create Local Config“ |
| 29 | +→ Datei `.vscode/formatter.json` wird erstellt |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## 🛠️ Beispiel-Konfiguration (`formatter.json`) |
| 34 | + |
| 35 | +```json5 |
| 36 | +{ |
| 37 | + "onSave": true, |
| 38 | + "html": { |
| 39 | + "indent_size": 2, |
| 40 | + "max_preserve_newlines": 2 |
| 41 | + }, |
| 42 | + "css": { |
| 43 | + "indent_size": 2, |
| 44 | + "newline_between_rules": true |
| 45 | + }, |
| 46 | + "javascript": { |
| 47 | + "indent_size": 2, |
| 48 | + "preserve_newlines": true |
| 49 | + } |
| 50 | +} |
| 51 | + |
| 52 | +## License and Credits |
| 53 | + |
| 54 | +This project is based on the original [JS-CSS-HTML Formatter by Lonefy](https://github.com/Lonefy/vscode-JS-CSS-HTML-formatter), |
| 55 | +licensed under the MIT License. |
| 56 | + |
| 57 | +Modified and updated for 2025 by **U:Bodigat**. |
0 commit comments