{
  "$id": "https://json.schemastore.org/swcrc.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "anyOf": [
    {
      "type": "array",
      "items": {
        "$ref": "#/definitions/entryPoint"
      }
    },
    {
      "$ref": "#/definitions/entryPoint"
    }
  ],
  "definitions": {
    "fileMatcher": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/definitions/fileMatcher"
          }
        }
      ]
    },
    "stringStringMap": {
      "type": "object",
      "patternProperties": {
        "": {
          "type": "string"
        }
      }
    },
    "featureOrModule": {
      "anyOf": [
        {
          "type": "string",
          "description": "CoreJS Module"
        },
        {
          "type": "string",
          "description": "Feature",
          "enum": [
            "transform-template-literals",
            "transform-literals",
            "transform-function-name",
            "transform-arrow-functions",
            "transform-block-scoped-functions",
            "transform-classes",
            "transform-object-super",
            "transform-shorthand-properties",
            "transform-duplicate-keys",
            "transform-computed-properties",
            "transform-for-of",
            "transform-sticky-regex",
            "transform-dotall-regex",
            "transform-unicode-regex",
            "transform-spread",
            "transform-parameters",
            "transform-destructuring",
            "transform-block-scoping",
            "transform-typeof-symbol",
            "transform-new-target",
            "transform-regenerator",
            "transform-exponentiation-operator",
            "transform-async-to-generator",
            "proposal-async-generator-functions",
            "proposal-object-rest-spread",
            "proposal-unicode-property-regex",
            "proposal-json-strings",
            "proposal-optional-catch-binding",
            "transform-named-capturing-groups-regex",
            "transform-member-expression-literals",
            "transform-property-literals",
            "transform-reserved-words",
            "proposal-nullish-coalescing-operator",
            "proposal-optional-chaining",
            "proposal-class-properties",
            "proposal-numeric-separator",
            "proposal-private-methods",
            "transform-unicode-escapes"
          ]
        }
      ]
    },
    "envVersion": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        }
      ]
    },
    "envVersions": {
      "type": "object",
      "propertyNames": {
        "enum": [
          "chrome",
          "ie",
          "edge",
          "firefox",
          "safari",
          "node",
          "ios",
          "samsung",
          "opera",
          "android",
          "electron",
          "phantom",
          "operaMobile"
        ]
      },
      "patternProperties": {
        "": {
          "$ref": "#/definitions/envVersion"
        }
      }
    },
    "envQuery": {
      "description": "Query",
      "oneOf": [
        {
          "description": "single query",
          "type": "string"
        },
        {
          "description": "multiple queries",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "envQueryOrVersion": {
      "description": "QueryOrVersion",
      "oneOf": [
        {
          "$ref": "#/definitions/envQuery"
        },
        {
          "$ref": "#/definitions/envVersion"
        }
      ]
    },
    "entryPoint": {
      "type": "object",
      "description": "Defines an entry point",
      "properties": {
        "env": {
          "type": "object",
          "properties": {
            "mode": {
              "type": "string",
              "enum": ["usage", "entry"]
            },
            "debug": {
              "type": "boolean"
            },
            "dynamicImport": {
              "type": "boolean"
            },
            "loose": {
              "type": "boolean"
            },
            "skip": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Skipped es-features. e.g.: 'core-js/modules/foo'"
            },
            "include": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/featureOrModule"
              }
            },
            "exclude": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/featureOrModule"
              }
            },
            "coreJs": {
              "type": "string"
            },
            "targets": {
              "oneOf": [
                {
                  "$ref": "#/definitions/envQuery"
                },
                {
                  "description": "EsModules",
                  "type": "object",
                  "properties": {
                    "esmodules": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "description": "Versions",
                  "$ref": "#/definitions/envVersions"
                },
                {
                  "description": "HashMap",
                  "type": "object",
                  "patternProperties": {
                    "": {
                      "$ref": "#/definitions/envQueryOrVersion"
                    }
                  }
                }
              ]
            },
            "shippedProposals": {
              "type": "boolean"
            },
            "forceAllTransforms": {
              "type": "boolean"
            },
            "bugfixes": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "test": {
          "$ref": "#/definitions/fileMatcher",
          "description": "Matches the files to include"
        },
        "exclude": {
          "$ref": "#/definitions/fileMatcher",
          "description": "Matches the files to exclude"
        },
        "minify": {
          "type": "boolean",
          "description": "If true, swc will minify the output"
        },
        "module": {
          "type": "object",
          "description": "Describes how swc will transpile the input",
          "properties": {
            "type": {
              "type": "string",
              "enum": ["commonjs", "amd", "umd", "es6"]
            },
            "strict": {
              "type": "boolean",
              "description": "If true, the __esModule property won't be added to the export",
              "default": false
            },
            "strictMode": {
              "type": "boolean",
              "description": "If true, swc emits the 'use strict' directive",
              "default": true
            },
            "lazy": {
              "anyOf": [
                {
                  "type": "boolean",
                  "description": "If true, lazy-initialize non local imports (not starting with ./)"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "RegEx matching file(s)"
                  },
                  "description": "Lazy-initialize all imports matching one of the given strings"
                }
              ],
              "default": false
            },
            "noInterop": {
              "type": "boolean",
              "description": "Disable the use of interopRequireDefault"
            },
            "moduleId": {
              "type": "string",
              "description": "If emitting amd-modules and specified, swc emits a named amd module"
            },
            "resolveFully": {
              "type": "boolean",
              "description": "Make resolver fully resolve index.js"
            },
            "globals": {
              "$ref": "#/definitions/stringStringMap"
            }
          },
          "required": ["type"],
          "additionalProperties": false
        },
        "$schema": {
          "type": "string"
        },
        "jsc": {
          "type": "object",
          "description": "Main Jsc configuration",
          "properties": {
            "parser": {
              "description": "Configures the parser",
              "type": "object",
              "oneOf": [
                {
                  "properties": {
                    "syntax": {
                      "enum": ["ecmascript"]
                    },
                    "jsx": {
                      "type": "boolean",
                      "description": "If true, transform jsx"
                    },
                    "numericSeparator": {
                      "type": "boolean",
                      "description": "Support numeric separator proposal (Stage 3)"
                    },
                    "classPrivateProperty": {
                      "type": "boolean",
                      "description": "Support private class properties"
                    },
                    "privateMethod": {
                      "type": "boolean",
                      "description": "Support private class methods"
                    },
                    "classProperty": {
                      "type": "boolean",
                      "description": "Support class properties"
                    },
                    "functionBind": {
                      "type": "boolean",
                      "description": "Support function bind expression"
                    },
                    "decorators": {
                      "type": "boolean",
                      "description": "Enable decorators"
                    },
                    "decoratorsBeforeExport": {
                      "type": "boolean"
                    },
                    "exportDefaultFrom": {
                      "type": "boolean"
                    },
                    "exportNamespaceFrom": {
                      "type": "boolean"
                    },
                    "dynamicImport": {
                      "type": "boolean"
                    },
                    "nullishCoalescing": {
                      "type": "boolean"
                    },
                    "optionalChaining": {
                      "type": "boolean"
                    },
                    "importMeta": {
                      "type": "boolean"
                    },
                    "topLevelAwait": {
                      "type": "boolean"
                    },
                    "importAssertions": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "properties": {
                    "syntax": {
                      "enum": ["typescript"]
                    },
                    "tsx": {
                      "type": "boolean",
                      "description": "If true, transform tsx"
                    },
                    "decorators": {
                      "type": "boolean",
                      "description": "If true, transform decorators"
                    },
                    "dynamicImport": {
                      "type": "boolean"
                    },
                    "dts": {
                      "type": "boolean",
                      "description": "[DISABLED] If true, emit .d.ts files. This flag is currently skipped by serde."
                    },
                    "noEarlyErrors": {
                      "type": "boolean",
                      "description": "[DISABLED] This flag is currently skipped by serde."
                    },
                    "importAssertions": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "transform": {
              "type": "object",
              "properties": {
                "react": {
                  "type": "object",
                  "properties": {
                    "development": {
                      "type": "boolean"
                    },
                    "importSource": {
                      "type": "string",
                      "default": "react"
                    },
                    "pragma": {
                      "type": "string",
                      "default": "React.createElement"
                    },
                    "pragmaFrag": {
                      "type": "string",
                      "default": "React.Fragment"
                    },
                    "refresh": {
                      "type": "boolean",
                      "default": false
                    },
                    "runtime": {
                      "type": "string",
                      "enum": ["automatic", "classic"],
                      "default": "classic"
                    },
                    "throwIfNamespace": {
                      "type": "boolean",
                      "default": true
                    },
                    "useBuiltins": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                "constModules": {
                  "type": "object",
                  "properties": {
                    "globals": {
                      "type": "object",
                      "patternProperties": {
                        "": {
                          "$ref": "#/definitions/stringStringMap"
                        }
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "optimizer": {
                  "type": "object",
                  "properties": {
                    "globals": {
                      "type": "object",
                      "properties": {
                        "vars": {
                          "$ref": "#/definitions/stringStringMap"
                        },
                        "envs": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "jsonify": {
                      "type": "object",
                      "properties": {
                        "minCost": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                },
                "legacyDecorator": {
                  "type": "boolean"
                },
                "decoratorMetadata": {
                  "type": "boolean",
                  "description": "If true, decorator metadata is emitted. Make sure \"Reflect\" is present."
                },
                "useDefineForClassFields": {
                  "type": "boolean",
                  "description": "If false, the old behaviour is used and _defineProperty is not generated for class properties.\nhttps://swc.rs/docs/configuration/compilation#jsctransformusedefineforclassfields",
                  "$comment": "Requires swc@1.3.40"
                },
                "hidden": {
                  "type": "object",
                  "properties": {
                    "jest": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "externalHelpers": {
              "type": "boolean",
              "description": "If true, this option will reduce the filesize by importing from an external module"
            },
            "preserveAllComments": {
              "type": "boolean",
              "description": "If true, all comments will be preserved during compilation"
            },
            "target": {
              "type": "string",
              "description": "Specifies the target environment",
              "enum": [
                "es3",
                "es5",
                "es2015",
                "es2016",
                "es2017",
                "es2018",
                "es2019",
                "es2020",
                "es2021",
                "es2022",
                "esnext"
              ]
            },
            "loose": {
              "type": "boolean",
              "description": "If true, swc generates more efficient code"
            },
            "keepClassNames": {
              "type": "boolean",
              "$comment": "Requires swc@1.2.50 and target es2016 or higher",
              "description": "Preserve original class names\nhttps://swc.rs/docs/configuration/compilation#jsckeepclassnames"
            },
            "paths": {
              "type": "object",
              "$comment": "Requires swc@1.2.62 and jsc.baseUrl",
              "description": "Should reflect \"paths\" property in project's tsconfig.json . See https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping"
            },
            "baseUrl": {
              "type": "string",
              "$comment": "Requires swc@1.2.62",
              "description": "Should reflect \"baseUrl\" property in project's tsconfig.json . See https://www.typescriptlang.org/docs/handbook/module-resolution.html#base-url"
            },
            "minify": {
              "title": "minification options",
              "type": "object",
              "$comment": "Requires swc@1.2.67",
              "description": "Minification options\nhttps://swc.rs/docs/configuration/minification"
            },
            "experimental": {
              "title": "experimental options",
              "type": "object",
              "description": "Experimental options\nhttps://swc.rs/docs/configuration/compilation#jscexperimental",
              "minProperties": 1,
              "properties": {
                "keepImportAssertions": {
                  "type": "boolean",
                  "description": "Preserve import assertions if true. This is experimental because import assertions are not covered by ecmascript specifications yet."
                },
                "plugins": {
                  "type": "array",
                  "description": "A list of plugins to load",
                  "minItems": 1,
                  "items": {
                    "type": "array",
                    "description": "A tuple with a plugin name and its options",
                    "minItems": 2,
                    "maxItems": 2,
                    "items": [
                      {
                        "type": "string",
                        "description": "Plugin name",
                        "minLength": 1
                      },
                      {
                        "type": "object",
                        "description": "Plugin options",
                        "additionalProperties": true
                      }
                    ]
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "skipHelperInjection": {
          "type": "boolean"
        },
        "disableHygiene": {
          "type": "boolean"
        },
        "disableFixer": {
          "type": "boolean"
        },
        "cwd": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "root": {
          "type": "string"
        },
        "swcrc": {
          "type": "boolean"
        },
        "envName": {
          "type": "string"
        },
        "sourceFileName": {
          "type": "string"
        },
        "sourceRoot": {
          "type": "string"
        },
        "isModule": {
          "type": "boolean"
        },
        "globalMark": {
          "type": "number"
        },
        "callerOptions": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "configFile": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "boolean"
            }
          ]
        },
        "rootMode": {
          "enum": ["root", "upward", "upward-optional"]
        },
        "inputSourceMap": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "boolean"
            }
          ]
        },
        "sourceMaps": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "boolean"
            }
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "description": "Schema for the swc configuration file",
  "title": "swc configuration schema"
}
