Event Hooks
Community

formatter

2 events · 2 hooks

Install
1
Install the plugin
$
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin formatter

Want just this hook?

Then install: npx claudepluginhub u/[userId]/[slug]

Risk Indicators
Modifies files
Source

Defined in hooks/hooks.json

Configuration
{
  "PreToolUse": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate-format.sh",
          "timeout": 3000,
          "description": "Checks if file is already formatted to avoid unnecessary changes",
          "continueOnError": true
        }
      ],
      "enabled": false,
      "matcher": "Edit",
      "priority": 50,
      "description": "Optional: Validate file format before editing (disabled by default)"
    }
  ],
  "PostToolUse": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "${CLAUDE_PLUGIN_ROOT}/scripts/format.sh",
          "timeout": 5000,
          "description": "Runs Prettier formatter on supported file types (JS, TS, JSON, CSS, MD)",
          "environment": {
            "NODE_ENV": "production",
            "PRETTIER_CONFIG": "${CLAUDE_PLUGIN_ROOT}/config/.prettierrc"
          },
          "continueOnError": true
        }
      ],
      "enabled": true,
      "matcher": "Write|Edit",
      "priority": 100,
      "description": "Auto-format code files after Write or Edit operations"
    }
  ]
}
Summary
{
  "riskFlags": {
    "touchesBash": false,
    "matchAllTools": false,
    "touchesFileWrites": true
  },
  "typeStats": {
    "command": 2
  },
  "eventStats": {
    "PreToolUse": 1,
    "PostToolUse": 1
  },
  "originCounts": {
    "absolutePaths": 0,
    "pluginScripts": 2,
    "projectScripts": 0
  },
  "timeoutStats": {
    "commandsWithoutTimeout": 0
  }
}
Stats
Stars1679
Forks211
Last CommitOct 11, 2025

Similar Hooks