{"library":"prettier-plugin-codeowners","title":"Prettier Plugin for CODEOWNERS","description":"A Prettier plugin (v0.1.1) that formats CODEOWNERS files used by GitHub to define code ownership. It automatically detects files named CODEOWNERS in any directory and applies formatting rules such as aligning owner columns per section, sorting owners alphabetically per line, preserving inline comments, normalizing whitespace, and collapsing blank lines. It requires Prettier ^3.0.0 as a peer dependency and is available on npm with active maintenance. Unlike generic file formatters, it understands CODEOWNERS syntax specific sections and no-owner lines.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-codeowners"],"cli":null},"imports":["const plugin = require('prettier-plugin-codeowners');","import plugin from 'prettier-plugin-codeowners';","prettier --write .github/CODEOWNERS --plugin=prettier-plugin-codeowners"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// Install:\n// npm install -D prettier prettier-plugin-codeowners\n\n// 1. Add to .prettierrc:\n// {\n//   \"plugins\": [\"prettier-plugin-codeowners\"]\n// }\n\n// 2. Format a CODEOWNERS file:\n// prettier --write .github/CODEOWNERS\n\n// 3. Or use programmatically:\nimport * as prettier from 'prettier';\nimport plugin from 'prettier-plugin-codeowners';\n\nconst source = `*       @owner1\n*.js         @owner2\n`;\n\nconst formatted = await prettier.format(source, {\n  plugins: [plugin],\n});\n\nconsole.log(formatted);\n// Output:\n// *            @owner1\n// *.js         @owner2\n","lang":"javascript","description":"Demonstrates installation, configuration, and programmatic usage of the plugin to format a CODEOWNERS file.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}