{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "default": "node_modules/barrelize/schema.json",
      "description": "Path to the JSON schema file that will be used for configuration validation",
      "type": "string"
    },
    "bracketSpacing": {
      "default": true,
      "description": "Whether to add spaces between brackets in export statements",
      "type": "boolean"
    },
    "singleQuote": {
      "default": true,
      "description": "Whether to use single quotes instead of double quotes for exports",
      "type": "boolean"
    },
    "semi": {
      "default": true,
      "description": "Whether to append semicolons to export statements",
      "type": "boolean"
    },
    "insertFinalNewline": {
      "default": true,
      "description": "Whether to append a newline character at the end of generated files",
      "type": "boolean"
    },
    "barrels": {
      "description": "List of barrel configurations",
      "default": [
        {
          "root": "src",
          "name": "index.ts",
          "include": [
            "**/*.ts"
          ],
          "exclude": [
            "**/*.test.ts"
          ]
        }
      ],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "root": {
            "default": "src",
            "description": "Root directory to start from (support glob pattern)",
            "type": "string"
          },
          "name": {
            "default": "index.ts",
            "description": "Name of the index file (e.g. index.ts or some/path/index.ts)",
            "type": "string"
          },
          "include": {
            "default": [
              "**/*.ts"
            ],
            "description": "Files to include in the barrel (supports glob patterns)",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "exclude": {
            "default": [
              "**/*.test.ts"
            ],
            "description": "Files to exclude from the barrel (supports glob patterns)",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "order": {
            "default": [],
            "description": "Ordering of exports",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "replace": {
            "default": {
              "/\\.ts$/": ""
            },
            "description": "String or regular expression patterns to find and replace in export paths (e.g. {\"\\.ts$\": \"\", \"my-custom-export-path.ts\": \"my-path.ts\"})",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string",
              "description": "String or regular expression pattern to find in export paths (e.g. \"\\.ts$\", \"my-custom-export-path.ts\")"
            }
          },
          "exports": {
            "default": {
              "**/*.ts": []
            },
            "description": "Configuration for exports in barrel files",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Glob pattern exports file with string or regular expression patterns (e.g. \"**/*service.ts\": [\"* as lib\", \"/(.+)Config$/ as $1LibConfig\", \"util\"])"
            }
          },
          "bracketSpacing": {
            "description": "Use spaces between brackets in exports",
            "type": "boolean"
          },
          "singleQuote": {
            "description": "Use single quotes for exports",
            "type": "boolean"
          },
          "semi": {
            "description": "Add semicolons after exports",
            "type": "boolean"
          },
          "insertFinalNewline": {
            "description": "Add newline at end of file",
            "type": "boolean"
          }
        }
      }
    }
  }
}
