{"library":"prettier-plugin-firestore-rules","title":"Prettier Plugin for Firestore Rules","description":"A prettier plugin to format Firebase Firestore Security Rules files (.rules). Version 0.1.5 adds support for the 'in' operator. It is a lightweight, single-purpose plugin that integrates with Prettier, providing consistent formatting for Firestore rules alongside other code. Compared to manual formatting or IDE extensions, it offers automated, reproducible formatting within the Prettier ecosystem. The plugin is actively maintained with regular releases and supports Node.js ≥11. It is an ideal choice for Firebase projects using Prettier, ensuring rules keep the same code style as the rest of the codebase.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-firestore-rules"],"cli":null},"imports":["No explicit import needed; use in .prettierrc or CLI as --plugin=prettier-plugin-firestore-rules","Files with .rules extension are automatically detected and formatted when plugin is registered","Add to .prettierrc: { \"plugins\": [\"prettier-plugin-firestore-rules\"] }"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// 1. Install plugin and prettier\nnpm install --save-dev prettier prettier-plugin-firestore-rules\n\n// 2. Create .prettierrc in project root\n// .prettierrc\n{\n  \"plugins\": [\"prettier-plugin-firestore-rules\"],\n  \"singleQuote\": true,\n  \"tabWidth\": 2\n}\n\n// 3. Format a .rules file (e.g., firestore.rules)\n// Run: npx prettier --write firestore.rules\n\n// Example firestore.rules before formatting:\n// rules_version = '2';\n// service cloud.firestore {\n// match /databases/{database}/documents {\n//   match /{document=**} {\n//     allow read, write: if false;\n//   }\n// }\n// }\n\n// After formatting:\n// rules_version = '2';\n// service cloud.firestore {\n//   match /databases/{database}/documents {\n//     match /{document=**} {\n//       allow read, write: if false;\n//     }\n//   }\n// }","lang":"javascript","description":"Install the plugin, configure .prettierrc to include the plugin, then format .rules files using prettier CLI.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}