{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"$id": "https://unpkg.com/@allons-y/opx/schema/config.json",
	"title": ".opx/config.json",
	"description": "Configuration for opx, the _optionally_ opinionated front-end toolkit. Each concern (lint, build, release, test) enables one or more plugins by short name.",
	"type": "object",
	"required": ["version"],
	"additionalProperties": false,
	"properties": {
		"$schema": { "type": "string", "format": "uri" },
		"version": { "type": "integer", "const": 1 },
		"lint": { "$ref": "#/$defs/dynamicTask" },
		"build": { "$ref": "#/$defs/dynamicTask" },
		"release": { "$ref": "#/$defs/staticTask" },
		"test": { "$ref": "#/$defs/staticTask" }
	},
	"$defs": {
		"pluginSetting": {
			"description": "How to enable a plugin: a flag, a path to a custom config file, or inline configuration.",
			"oneOf": [
				{
					"type": "boolean",
					"description": "A simple flag to enable or disable the plugin with default behaviors.",
					"default": false
				},
				{
					"type": "string",
					"description": "A relative path to a file containing the custom configuration for the plugin."
				},
				{
					"type": "object",
					"description": "Inline configuration settings for the plugin."
				}
			]
		},
		"dynamicTask": {
			"type": "object",
			"description": "File-type-specific plugins keyed by short name (e.g. 'js', 'css', 'md', 'json').",
			"propertyNames": {
				"type": "string",
				"pattern": "^[a-z0-9]+$",
				"examples": ["js", "ts", "css", "md", "json"]
			},
			"additionalProperties": { "$ref": "#/$defs/pluginSetting" }
		},
		"staticTask": { "$ref": "#/$defs/pluginSetting" }
	}
}
