{
  "$schema": "http://json-schema.org/schema",
  "cli": "nx",
  "$id": "NxReactHook",
  "title": "Create a React Hook for Nx",
  "description": "Create a React component using Hooks in a dedicated React project.",
  "type": "object",
  "examples": [
    {
      "command": "nx g hook my-hook --project=mylib",
      "description": "Generate a hook in the `mylib` library"
    }
  ],
  "properties": {
    "project": {
      "type": "string",
      "description": "The name of the project.",
      "alias": "p",
      "$default": {
        "$source": "projectName"
      },
      "x-prompt": "What is the name of the project for this hook?"
    },
    "name": {
      "type": "string",
      "description": "The name of the hook.",
      "$default": {
        "$source": "argv",
        "index": 0
      },
      "x-prompt": "What name would you like to use for the hook?"
    },
    "js": {
      "type": "boolean",
      "description": "Generate JavaScript files rather than TypeScript files.",
      "default": false
    },
    "skipTests": {
      "type": "boolean",
      "description": "When true, does not create `spec.ts` test files for the new hook.",
      "default": false
    },
    "directory": {
      "type": "string",
      "description": "Create the hook under this directory (can be nested).",
      "alias": "d"
    },
    "flat": {
      "type": "boolean",
      "description": "Create hook at the source root rather than its own directory.",
      "default": false
    },
    "export": {
      "type": "boolean",
      "description": "When true, the hook is exported from the project `index.ts` (if it exists).",
      "alias": "e",
      "default": false,
      "x-prompt": "Should this hook be exported in the project?"
    },
    "pascalCaseFiles": {
      "type": "boolean",
      "description": "Use pascal case hook file name (e.g. `useHook.ts`).",
      "alias": "P",
      "default": false
    },
    "pascalCaseDirectory": {
      "type": "boolean",
      "description": "Use pascal case directory name (e.g. `useHook/useHook.ts`).",
      "alias": "R",
      "default": false
    }
  },
  "required": ["name", "project"]
}
