Automatically organizes imports and formats Angular .ts, .html, .css, and .scss files using Prettier — on save or across the entire src/ folder in one command, all without opening or switching tabs.
Features
Format on Save — automatically organizes imports (TS) and formats the active file every time you save.
Format All Files — formats every .ts, .html, .css, and .scss file inside src/ in the background.
Organize Imports — removes unused and sorts TypeScript imports automatically.
Style Support — full formatting support for CSS and SCSS stylesheets.
Scoped to src/ — batch formatting ignores node_modules, dist, out, and .git automatically.
Respects your Prettier config — picks up .prettierrc or prettier.config.js from your workspace.
Commands
Open the Command Palette (CTRL+SHIFT+P) and run:
Command
Description
Angular: Organize and Format
Organizes imports (TS) and formats the currently open file
Angular: Format All Files in Workspace
Formats all .ts, .html, .css, and .scss files in src/ in the background
Usage
Format the current file
Save the file — formatting runs automatically. Or run Angular: Organize and Format from the Command Palette.
Note: "Organize Imports" is applied to TypeScript files only, while formatting is applied to all supported types.
Format the entire project
CTRL+SHIFT+P → Angular: Format All Files in Workspace
A progress notification appears in the bottom-right corner. Files are formatted and saved in the background — your open tabs and editor focus are never disturbed.