Promptzpromptz
LibrariesPromptsAgentsPowersSteeringHooks
Contribute
Back to Hooks
hookkiro-best-practices
IDE

Lint And Format On Save

Automatically lint and format code when files are saved following project standards

Vivek Velso
Aug 7, 2025
Updated Aug 7, 2025
901b1f7
View on GitHub
Hook Configuration
{
  "enabled": true,
  "name": "Lint and Format on Save",
  "description": "Automatically lint and format code when files are saved following project standards",
  "version": "1",
  "when": {
    "type": "fileEdited",
    "patterns": [
      "**/*.ts",
      "**/*.js",
      "**/*.tsx",
      "**/*.jsx",
      "**/*.py",
      "**/*.json"
    ]
  },
  "then": {
    "type": "askAgent",
    "prompt": "A code file has been saved. Please:\n1. Run the appropriate linter (ESLint for JS/TS, flake8/pylint for Python)\n2. Run the appropriate formatter (Prettier for JS/TS, Black for Python)\n3. Fix any auto-fixable issues\n4. Report any remaining issues that need manual attention\n\nUse the project's existing configuration files (.eslintrc, .prettierrc, pyproject.toml, etc.) and follow the established coding standards."
  }
}