Docs
hooks.json

hooks.json

Configuration for your project.

The hooks.json file holds configuration for your project.

We use it to understand how your project is set up and how to generate components customized for your project.

You can create a hooks.json file in your project by running the following command:

npx scriptkavi-hooks@latest init

See the CLI section for more information.

$schema

You can see the JSON Schema for hooks.json here.

hooks.json
{
  "$schema": "https://hooks.scriptkavi.com/schema.json"
}

codestyle

The coding style for your hooks. This defines whether your hooks are react based or pure javascript. This cannot be changed after initialization.

hooks.json
{
  "codestyle": "react-hook"
}

tsx

Choose between TypeScript or JavaScript hooks.

Setting this option to false allows hooks to be added as JavaScript with the .js file extension.

hooks.json
{
  "tsx": `true` | `false`
}

aliases

The CLI uses these values and the paths config from your tsconfig.json or jsconfig.json file to place generated hooks in the correct location.

Path aliases have to be set up in your tsconfig.json or jsconfig.json file.

aliases.utils

Import alias for your utility functions.

hooks.json
{
  "aliases": {
    "utils": "@/lib/utils"
  }
}

aliases.hooks

Import alias for your hooks.

hooks.json
{
  "aliases": {
    "hooks": "@/hooks"
  }
}