{"library":"prettier-plugin-terraform-formatter","title":"Prettier Terraform Formatter Plugin","description":"A Prettier plugin that formats Terraform files by shelling out to the local `terraform fmt` command. Version 1.2.1 is the current stable release, with a maintenance cadence. Unlike other Terraform formatters (like `terraform fmt` directly), this integrates with Prettier workflows and respects Prettier's file matching and option system. The Terraform CLI must be installed separately. Supports `terraformStrictError` option to control error behavior when terraform is not found.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-terraform-formatter"],"cli":null},"imports":["// No explicit import needed, Prettier autoloads plugin","// In .prettierrc: { \"plugins\": [\"prettier-plugin-terraform-formatter\"], \"terraformStrictError\": true }"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// 1. Install: npm i -D prettier prettier-plugin-terraform-formatter\n// 2. Ensure terraform CLI is installed: which terraform\n// 3. Create .prettierrc:\n{\n  \"plugins\": [\"prettier-plugin-terraform-formatter\"],\n  \"overrides\": [\n    {\n      \"files\": \"*.tf\",\n      \"options\": {\n        \"parser\": \"terraform\"\n      }\n    }\n  ]\n}\n// 4. Format: npx prettier --write main.tf","lang":"javascript","description":"Install plugin, set up config with terraform parser override, then format files via CLI.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}