Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>FormatXNew to Visual Studio Code? Get it now.
FormatX

FormatX

Ahum Maitra

|
68 installs
| (1) | Free
Universal code formatter for VS Code using real tools like Prettier, Black, ClangFormat, Rustfmt & more.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

✨ FormatX — Universal Code Formatter for VS Code

FormatX is your all-in-one code formatter that supports multiple programming languages out of the box!
No more juggling multiple extensions — just one command, one shortcut, one tool. 🎯

FormatX Logo


🚀 Features

  • 🧠 Supports popular languages:
    • Python (black)
    • JavaScript, TypeScript, HTML, CSS, JSON (prettier)
    • C, C++, Java (clang-format)
    • Rust (rustfmt)
  • ⚡ Fast, simple, and efficient
  • 💾 Automatically saves after formatting
  • 🔧 Easy to use from command palette or right-click menu
  • 🔍 Minimal setup — just install required formatters once

🛠️ Installation

📦 From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for FormatX
  4. Click Install

🔧 From CLI

code --install-extension AhumMaitra.formatx
'''
## 📂 How to Use

### ✅ Format your code

- Open a supported file (`.py`, `.js`, `.cpp`, etc.)
- Run the FormatX command:
  - Press `Ctrl+Shift+P`
  - Select `FormatX: Format Code`
- Or right-click → `FormatX: Format Code`

Your file will be **formatted and auto-saved**! 💾

---

## ⚙️ Requirements

FormatX uses popular formatters. Please install them globally:

| Language       | Formatter      | Install Command                                      |
|----------------|----------------|------------------------------------------------------|
| Python         | `black`        | `pip install black`                                  |
| JS / TS / HTML | `prettier`     | `npm install -g prettier`                            |
| C / C++ / Java | `clang-format` | `sudo apt install clang-format` / via LLVM installer |
| Rust           | `rustfmt`      | `rustup component add rustfmt`                       |

Ensure these formatters are available in your system `PATH`.

---

## 🧪 Example

### Python

```python
print(   "Hello, World!" )

→ Run FormatX → ✅ Formatted to:

print("Hello, World!")

❓ Troubleshooting

  • Formatter not recognized?
    ➜ Make sure it's installed and available globally in your terminal (black, prettier, etc.)

  • "Unexpected indent" or parser error?
    ➜ Check Python version. Some syntax requires Python 3.10+.

  • "Cannot use --safe" error?
    ➜ Remove --safe option if file is new or syntax is broken.


🔗 Repository

🛠 GitHub: https://github.com/TheAhumMaitra/FormatX

📂 Clone the project:

git clone https://github.com/TheAhumMaitra/FormatX
cd FormatX
npm install
npm run compile
code .

Then hit F5 to launch your extension in a new VS Code window.


🌍 Supported Languages

Language Extension Formatter
Python .py black
JavaScript .js prettier
TypeScript .ts prettier
HTML / CSS .html/.css prettier
JSON .json prettier
C / C++ .c/.cpp clang-format
Java .java clang-format
Rust .rs rustfmt

🤝 Contributing

We welcome contributions! To get started:

  1. Fork the repo
  2. Create a new branch: git checkout -b feat/your-feature
  3. Commit changes: git commit -m "Add awesome feature"
  4. Push and create a PR

💬 Found a bug or want a feature? Open an issue


📜 License

This project is licensed under the MIT License.


🙌 Credits

Created with ❤️ by Ahum Maitra
🚀 YouTube: Programming with Ahum
🐙 GitHub: TheAhumMaitra

Special thanks to:

  • VS Code API
  • Community-supported formatters like Black, Prettier, ClangFormat, and RustFmt


Stay magical, stay formatted! 🧙‍♂️✨ ---#� �F�o�r�m�a�t�X� � �

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft