sverweij/dependency-cruiser

View on GitHub
src/schema/configuration.schema.json

Summary

Maintainability
Test Coverage
{
  "title": "dependency-cruiser configuration",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://dependency-cruiser.js.org/schema/configuration.schema.json",
  "description": "A set of properties describing what dependencies are forbidden and what dependencies are allowed + options on how to cruise through the code",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": { "type": "string" },
    "forbidden": {
      "type": "array",
      "description": "A list of rules that describe dependencies that are not allowed. dependency-cruiser will emit a separate error (warning/ informational) messages for each violated rule.",
      "items": { "$ref": "#/definitions/ForbiddenRuleType" }
    },
    "allowed": {
      "type": "array",
      "description": "A list of rules that describe dependencies that are allowed. dependency-cruiser will emit the warning message 'not-in-allowed' for each dependency that does not at least meet one of them.",
      "items": { "$ref": "#/definitions/AllowedRuleType" }
    },
    "allowedSeverity": {
      "$ref": "#/definitions/SeverityType",
      "description": "Severity to use when a dependency is not in the 'allowed' set of rules. Defaults to 'warn'"
    },
    "required": {
      "type": "array",
      "description": "A list of rules that describe what dependencies modules _must_ have. E.g. - every controller needs to (directly) depend on a base controller. - each source file should be the dependency of a spec file with the same    base name",
      "items": { "$ref": "#/definitions/RequiredRuleType" }
    },
    "options": { "$ref": "#/definitions/OptionsType" },
    "extends": { "$ref": "#/definitions/ExtendsType" }
  },
  "definitions": {
    "RuleSetType": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "forbidden": {
          "type": "array",
          "description": "A list of rules that describe dependencies that are not allowed. dependency-cruiser will emit a separate error (warning/ informational) messages for each violated rule.",
          "items": { "$ref": "#/definitions/ForbiddenRuleType" }
        },
        "allowed": {
          "type": "array",
          "description": "A list of rules that describe dependencies that are allowed. dependency-cruiser will emit the warning message 'not-in-allowed' for each dependency that does not at least meet one of them.",
          "items": { "$ref": "#/definitions/AllowedRuleType" }
        },
        "allowedSeverity": {
          "$ref": "#/definitions/SeverityType",
          "description": "Severity to use when a dependency is not in the 'allowed' set of rules. Defaults to 'warn'"
        },
        "required": {
          "type": "array",
          "description": "A list of rules that describe what dependencies modules _must_ have. E.g. - every controller needs to (directly) depend on a base controller. - each source file should be the dependency of a spec file with the same    base name",
          "items": { "$ref": "#/definitions/RequiredRuleType" }
        }
      }
    },
    "AllowedRuleType": {
      "oneOf": [
        { "$ref": "#/definitions/RegularAllowedRuleType" },
        { "$ref": "#/definitions/ReachabilityAllowedRuleType" }
      ]
    },
    "RegularAllowedRuleType": {
      "type": "object",
      "required": ["from", "to"],
      "additionalProperties": false,
      "properties": {
        "comment": { "type": "string" },
        "scope": {
          "type": "string",
          "description": "What to apply the rule to - modules (the default) or folders. Currently ignored for 'allowed' rules, defaulting to 'module'",
          "enum": ["module", "folder"]
        },
        "from": { "$ref": "#/definitions/FromRestrictionType" },
        "to": { "$ref": "#/definitions/ToRestrictionType" }
      }
    },
    "ReachabilityAllowedRuleType": {
      "type": "object",
      "required": ["from", "to"],
      "additionalProperties": false,
      "properties": {
        "comment": { "type": "string" },
        "scope": {
          "type": "string",
          "description": "What to apply the rule to - modules (the default) or folders. Currently ignored for 'allowed' rules, defaulting to 'module'",
          "enum": ["module", "folder"]
        },
        "from": { "$ref": "#/definitions/ReachabilityFromRestrictionType" },
        "to": { "$ref": "#/definitions/ReachabilityToRestrictionType" }
      }
    },
    "ForbiddenRuleType": {
      "oneOf": [
        { "$ref": "#/definitions/RegularForbiddenRuleType" },
        { "$ref": "#/definitions/ReachabilityForbiddenRuleType" },
        { "$ref": "#/definitions/DependentsForbiddenRuleType" }
      ]
    },
    "RegularForbiddenRuleType": {
      "type": "object",
      "required": ["from", "to"],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "description": "A short name for the rule - will appear in reporters to enable customers to quickly identify a violated rule. Try to keep them short, eslint style. E.g. 'not-to-core' for a rule forbidding dependencies on core modules, or 'not-to-unresolvable' for one that prevents dependencies on modules that probably don't exist."
        },
        "severity": { "$ref": "#/definitions/SeverityType" },
        "scope": {
          "type": "string",
          "description": "What to apply the rule to - modules (the default) or folders. Switching the scope to 'folder' can be useful in rules where this makes a difference like those regarding circular dependencies or instability. Only the to.moreUnstable, to.circular, and path (both from and to) attributes work at the moment. Other attributes will follow suit in later releases (depending on demand).",
          "enum": ["module", "folder"]
        },
        "comment": {
          "type": "string",
          "description": "You can use this field to document why the rule is there."
        },
        "from": { "$ref": "#/definitions/FromRestrictionType" },
        "to": { "$ref": "#/definitions/ToRestrictionType" }
      }
    },
    "DependentsForbiddenRuleType": {
      "type": "object",
      "required": ["module", "from"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string" },
        "severity": { "$ref": "#/definitions/SeverityType" },
        "scope": {
          "type": "string",
          "description": "What to apply the rule to - modules (the default) or folders. Currently ignored for DependentsForbiddenRules, defaulting to 'module'",
          "enum": ["module", "folder"]
        },
        "comment": { "type": "string" },
        "module": { "$ref": "#/definitions/DependentsModuleRestrictionType" },
        "from": { "$ref": "#/definitions/DependentsFromRestrictionType" }
      }
    },
    "ReachabilityForbiddenRuleType": {
      "type": "object",
      "required": ["from", "to"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string" },
        "severity": { "$ref": "#/definitions/SeverityType" },
        "scope": {
          "type": "string",
          "description": "What to apply the rule to - modules (the default) or folders. Currently ignored for ReachabilityForbiddenRules, defaulting to 'module'",
          "enum": ["module", "folder"]
        },
        "comment": { "type": "string" },
        "from": { "$ref": "#/definitions/ReachabilityFromRestrictionType" },
        "to": { "$ref": "#/definitions/ReachabilityToRestrictionType" }
      }
    },
    "RequiredRuleType": {
      "type": "object",
      "required": ["module", "to"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string" },
        "severity": { "$ref": "#/definitions/SeverityType" },
        "scope": {
          "type": "string",
          "description": "What to apply the rule to - modules (the default) or folders. Currently ignored for RequiredRules, defaulting to 'module'",
          "enum": ["module", "folder"]
        },
        "comment": { "type": "string" },
        "module": { "$ref": "#/definitions/RequiredModuleRestrictionType" },
        "to": { "$ref": "#/definitions/RequiredToRestrictionType" }
      }
    },
    "MiniDependencyRestrictionType": {
      "oneOf": [
        { "$ref": "#/definitions/REAsStringsType" },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "path": {
              "description": "A regular expression or an array of regular expressions the  'via' module should match to be caught by this rule.",
              "$ref": "#/definitions/REAsStringsType"
            },
            "pathNot": {
              "description": "A regular expression or an array of regular expressions an the  'via' module should _not_ match to be caught by this rule.",
              "$ref": "#/definitions/REAsStringsType"
            },
            "dependencyTypes": {
              "type": "array",
              "description": "Which dependency types the dependency between this via and the previous one in the 'via chain' should have to be caught by this rule.",
              "items": { "$ref": "#/definitions/DependencyTypeType" }
            },
            "dependencyTypesNot": {
              "type": "array",
              "description": "Which dependency types the dependency between this via and the previous one in the 'via chain' should _not_ have to be caught by this rule.",
              "items": { "$ref": "#/definitions/DependencyTypeType" }
            }
          }
        }
      ]
    },
    "FromRestrictionType": {
      "type": "object",
      "description": "Criteria an end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "pathNot": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "orphan": {
          "type": "boolean",
          "description": "Whether or not to match when the module is an orphan (= has no incoming or outgoing dependencies). When this property it is part of a rule, dependency-cruiser will ignore the 'to' part."
        }
      }
    },
    "ReachabilityFromRestrictionType": {
      "type": "object",
      "description": "Criteria an end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "pathNot": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        }
      }
    },
    "ToRestrictionType": {
      "type": "object",
      "description": "Criteria the 'to' end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "pathNot": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "couldNotResolve": {
          "type": "boolean",
          "description": "Whether or not to match modules dependency-cruiser could not resolve (and probably aren't on disk). For this one too: leave out if you don't care either way."
        },
        "circular": {
          "type": "boolean",
          "description": "Whether or not to match when following to the to will ultimately end up in the from."
        },
        "dynamic": {
          "type": "boolean",
          "description": "Whether or not to match when the dependency is a dynamic one."
        },
        "exoticallyRequired": {
          "type": "boolean",
          "description": "Whether or not to match when the dependency is exotically required."
        },
        "exoticRequire": {
          "description": "A regular expression to match against any 'exotic' require strings",
          "$ref": "#/definitions/REAsStringsType"
        },
        "exoticRequireNot": {
          "description": "A regular expression to match against any 'exotic' require strings - when it should NOT be caught by the rule",
          "$ref": "#/definitions/REAsStringsType"
        },
        "preCompilationOnly": {
          "type": "boolean",
          "description": "true if this dependency only exists before compilation (like type only imports), false in all other cases. Only returned when the tsPreCompilationDeps is set to 'specify'."
        },
        "dependencyTypes": {
          "type": "array",
          "description": "Whether or not to match modules of any of these types (leaving out matches any of them)",
          "items": { "$ref": "#/definitions/DependencyTypeType" }
        },
        "dependencyTypesNot": {
          "type": "array",
          "description": "Whether or not to match modules NOT of any of these types (leaving out matches none of them)",
          "items": { "$ref": "#/definitions/DependencyTypeType" }
        },
        "moreThanOneDependencyType": {
          "type": "boolean",
          "description": "If true matches dependencies with more than one dependency type (e.g. defined in _both_ npm and npm-dev)"
        },
        "license": {
          "description": "Whether or not to match modules that were released under one of the mentioned licenses. E.g. to flag GPL-1.0, GPL-2.0 licensed modules (e.g. because your app is not compatible with the GPL) use \"GPL\"",
          "$ref": "#/definitions/REAsStringsType"
        },
        "licenseNot": {
          "description": "Whether or not to match modules that were NOT released under one of the mentioned licenses. E.g. to flag everything non MIT use \"MIT\" here",
          "$ref": "#/definitions/REAsStringsType"
        },
        "via": {
          "description": "For circular dependencies - whether or not to match cycles that include some modules with these conditions. If you want to match cycles that _exclusively_ include modules satisfying them use the viaOnly restriction.E.g. to allow all cycles, except when they go through one specific module. Typically to temporarily disallow some cycles with a lower severity - setting up a rule with a via that ignores them in an 'allowed' section.",
          "$ref": "#/definitions/MiniDependencyRestrictionType"
        },
        "viaOnly": {
          "description": "For circular dependencies - whether or not to match cycles that include exclusively modules with these conditions. This is different from the regular via that already matches when only _some_ of the modules in the cycle satisfy the condition.",
          "$ref": "#/definitions/MiniDependencyRestrictionType"
        },
        "viaNot": {
          "description": "This attribute is deprecated. Use 'viaOnly' with a 'pathNot' attribute in stead.",
          "deprecated": true,
          "$ref": "#/definitions/REAsStringsType"
        },
        "viaSomeNot": {
          "description": "This attribute is deprecated. Use 'via' with a 'pathNot' attribute in stead.",
          "deprecated": true,
          "$ref": "#/definitions/REAsStringsType"
        },
        "moreUnstable": {
          "type": "boolean",
          "description": "When set to true moreUnstable matches for any dependency that has a higher Instability than the module that depends on it. When set to false it matches when the opposite is true; the dependency has an equal or lower Instability. This attribute is useful when you want to check against Robert C. Martin's stable dependency principle. See online documentation for examples and details. Leave this out when you don't care either way."
        }
      }
    },
    "DependentsModuleRestrictionType": {
      "description": "Criteria to select the module(s) this restriction should apply to",
      "required": [],
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "pathNot": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "numberOfDependentsLessThan": {
          "type": "integer",
          "description": "Matches when the number of times the 'to' module is used falls below (<) this number. Caveat: only works in concert with path and pathNot restrictions in the from and to parts of the rule; other conditions will be ignored. E.g. to flag modules that are used only once or not at all, use 2 here.",
          "minimum": 0,
          "maximum": 100
        },
        "numberOfDependentsMoreThan": {
          "type": "integer",
          "description": "Matches when the number of times the 'to' module is used raises above (>) this number. Caveat: only works in concert with path and pathNot restrictions in the from and to parts of the rule; other conditions will be ignored. E.g. to flag modules that are used more than 10 times, use 10 here.",
          "minimum": 0,
          "maximum": 100
        }
      }
    },
    "DependentsFromRestrictionType": {
      "description": "Criteria the dependents of the module should adhere to be caught by this rule rule. Leave it empty if you want any dependent to be matched.",
      "required": [],
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "pathNot": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        }
      }
    },
    "ReachabilityToRestrictionType": {
      "description": "Criteria the 'to' end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
      "required": ["reachable"],
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "pathNot": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "reachable": {
          "type": "boolean",
          "description": "Whether or not to match modules that aren't reachable from the from part of the rule."
        }
      }
    },
    "RequiredModuleRestrictionType": {
      "description": "Criteria to select the module(s) this restriction should apply to",
      "required": [],
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "pathNot": {
          "description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
          "$ref": "#/definitions/REAsStringsType"
        }
      }
    },
    "RequiredToRestrictionType": {
      "description": "Criteria for modules the associated module must depend on.",
      "required": [],
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "Criteria at least one dependency of each matching module must adhere to.",
          "$ref": "#/definitions/REAsStringsType"
        }
      }
    },
    "DependencyTypeType": {
      "type": "string",
      "enum": [
        "aliased-subpath-import",
        "aliased-tsconfig-base-url",
        "aliased-tsconfig-paths",
        "aliased-tsconfig",
        "aliased-webpack",
        "aliased-workspace",
        "aliased",
        "amd-define",
        "amd-require",
        "amd-exotic-require",
        "core",
        "deprecated",
        "dynamic-import",
        "exotic-require",
        "export",
        "import-equals",
        "import",
        "local",
        "localmodule",
        "npm-bundled",
        "npm-dev",
        "npm-no-pkg",
        "npm-optional",
        "npm-peer",
        "npm-unknown",
        "npm",
        "pre-compilation-only",
        "require",
        "triple-slash-amd-dependency",
        "triple-slash-directive",
        "triple-slash-file-reference",
        "triple-slash-type-reference",
        "type-import",
        "type-only",
        "undetermined",
        "unknown"
      ]
    },
    "REAsStringsType": {
      "oneOf": [
        { "type": "string" },
        { "type": "array", "items": { "type": "string" } }
      ]
    },
    "SeverityType": {
      "type": "string",
      "description": "How severe a violation of a rule is. The 'error' severity will make some reporters return a non-zero exit code, so if you want e.g. a build to stop when there's a rule violated: use that.",
      "enum": ["error", "warn", "info", "ignore"]
    },
    "OptionsType": {
      "type": "object",
      "description": "Runtime configuration options",
      "additionalProperties": false,
      "properties": {
        "doNotFollow": {
          "description": "a regular expression for modules to include, but not follow further",
          "oneOf": [
            { "$ref": "#/definitions/REAsStringsType" },
            { "$ref": "#/definitions/CompoundDoNotFollowType" }
          ]
        },
        "exclude": {
          "description": "a regular expression for modules to exclude from being cruised",
          "oneOf": [
            { "$ref": "#/definitions/REAsStringsType" },
            { "$ref": "#/definitions/CompoundExcludeType" }
          ]
        },
        "includeOnly": {
          "description": "a regular expression for modules to cruise; anything outside it will be skipped",
          "oneOf": [
            { "$ref": "#/definitions/REAsStringsType" },
            { "$ref": "#/definitions/CompoundIncludeOnlyType" }
          ]
        },
        "focus": {
          "description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
          "oneOf": [
            { "$ref": "#/definitions/REAsStringsType" },
            { "$ref": "#/definitions/CompoundFocusType" }
          ]
        },
        "reaches": {
          "description": "dependency-cruiser will include modules matching this regular expression in its output, as well as _any_ module that reaches them - either directly or via via",
          "oneOf": [
            { "$ref": "#/definitions/REAsStringsType" },
            { "$ref": "#/definitions/CompoundReachesType" }
          ]
        },
        "highlight": {
          "description": "dependency-cruiser will mark modules matching this regular expression as 'highlighted' in its output",
          "oneOf": [
            { "$ref": "#/definitions/REAsStringsType" },
            { "$ref": "#/definitions/CompoundHighlightType" }
          ]
        },
        "knownViolations": {
          "description": "baseline of known validations. Typically you'd specify these in a file called .dependency-cruiser-known-violations.json (which you'd generate with the --outputType 'baseline') - and which is easy to keep up to date. In a pinch you can specify them here as well. The known violations in .dependency-cruiser-known-violations.json always take precedence.",
          "$ref": "#/definitions/ViolationsType"
        },
        "collapse": {
          "description": "Collapse a to a folder depth by passing a single digit (e.g. 2). When passed a regex collapses to that pattern E.g. ^packages/[^/]+/ would collapse to modules/ folders directly under your packages folder.",
          "oneOf": [
            { "type": "string" },
            { "type": "integer", "minimum": 1, "maximum": 9 }
          ]
        },
        "maxDepth": {
          "type": "integer",
          "minimum": 0,
          "maximum": 99,
          "description": "The maximum cruise depth specified. 0 means no maximum specified. While it might look attractive to regulate the size of the output, this is not the best option to do so. Filters (exclude, includeOnly, focus), the dot and archi reporter's collapsePattern and the collapse options offer better, more reliable and more understandable results."
        },
        "moduleSystems": { "$ref": "#/definitions/ModuleSystemsType" },
        "prefix": { "type": "string" },
        "preserveSymlinks": {
          "type": "boolean",
          "description": "if true leave symlinks untouched, otherwise use the realpath. Defaults to `false` (which is also nodejs's default behavior since version 6)"
        },
        "combinedDependencies": {
          "type": "boolean",
          "description": "if true combines the package.jsons found from the module up to the base folder the cruise is initiated from. Useful for how (some) mono-repos manage dependencies & dependency definitions. Defaults to `false`."
        },
        "tsConfig": {
          "type": "object",
          "additionalProperties": false,
          "description": "TypeScript project file ('tsconfig.json') to use for (1) compilation and (2) resolution (e.g. with the paths property)",
          "properties": {
            "fileName": {
              "description": "The TypeScript project file to use. The fileName is relative to dependency-cruiser's current working directory. When not provided defaults to './tsconfig.json'.",
              "type": "string"
            }
          }
        },
        "tsPreCompilationDeps": {
          "description": "if true detect dependencies that only exist before typescript-to-javascript compilation.",
          "oneOf": [
            { "type": "boolean" },
            { "type": "string", "enum": ["specify"] }
          ]
        },
        "extraExtensionsToScan": {
          "type": "array",
          "description": "List of extensions to scan _in addition_ to the extensions already covered by any available parser. Dependency-cruiser will consider files ending in these extensions but it will _not_ examine its content or derive any of their dependencies Sample value: [\".jpg\", \".png\", \".json\"]",
          "items": { "type": "string" }
        },
        "externalModuleResolutionStrategy": {
          "type": "string",
          "description": "What external module resolution strategy to use. Defaults to 'node_modules' (not used anymore - module resolution strategy determination is automatic now)",
          "enum": ["node_modules", "yarn-pnp"]
        },
        "builtInModules": {
          "type": "object",
          "additionalProperties": false,
          "description": "Options to tweak what dependency-cruiser considers 'built-in' modules. If you're targeting nodejs, or don't use any built-in modules you can probably leave this alone.",
          "properties": {
            "override": {
              "type": "array",
              "description": "List of module names that are to be considered as 'built-in'. By default dependency-cruiser uses the list of built-ins from nodejs. If you code for another environment (e.g. the browser) and you use shims for nodejs builtins like 'path' from node_modules, you could pass an empty array here. If you want to just add a couple of extra built-ins to the default list, use the 'add' attribute instead.",
              "items": { "type": "string" }
            },
            "add": {
              "type": "array",
              "description": "List of module names that are to be considered as 'built-in' in addition to the default list of the environment you're currently in. Use this e.g. if you're writing electron code and want to add 'electron' as built-in.",
              "items": { "type": "string" }
            }
          }
        },
        "forceDeriveDependents": {
          "type": "boolean",
          "description": "When true includes de-normalized dependents in the cruise-result, even though there's no rule in the rule set that requires them. Defaults to false."
        },
        "webpackConfig": {
          "type": "object",
          "additionalProperties": false,
          "description": "Webpack configuration file to use to get resolve options from",
          "properties": {
            "fileName": {
              "type": "string",
              "description": "The webpack conf file to use (typically something like 'webpack.conf.js'). The fileName is relative to dependency-cruiser's current working directory. When not provided defaults to './webpack.conf.js'."
            },
            "env": {
              "description": "Environment to pass if your config file returns a function",
              "oneOf": [{ "type": "object" }, { "type": "string" }]
            },
            "arguments": {
              "type": "object",
              "description": "Arguments to pass if your config file returns a function. E.g. {mode: 'production'} if you want to use webpack 4's 'mode' feature"
            }
          }
        },
        "enhancedResolveOptions": {
          "type": "object",
          "additionalProperties": false,
          "description": "Options used in module resolution that for dependency-cruiser's use cannot go in a webpack config. For details please refer to the documentation of enhanced-resolve itself.",
          "properties": {
            "exportsFields": {
              "type": "array",
              "description": "List of strings to consider as 'exports' fields in package.json. Use ['exports'] when you use packages that use such a field and your environment supports it (e.g. node ^12.19 || >=14.7 or recent versions of webpack).",
              "items": { "type": "string" }
            },
            "conditionNames": {
              "type": "array",
              "description": "List of conditions to check for in the exports field. e.g. use `['imports']` if you're only interested in exposed es6 modules, ['require'] for commonjs, or all conditions at once (['import', 'require', 'node', 'default']) if anything goes for you. Only works when the 'exportsFields' array is non-empty",
              "items": { "type": "string" }
            },
            "extensions": {
              "type": "array",
              "description": "List of extensions to scan for when resolving. Typically you want to leave this alone as dependency-cruiser figures out what extensions to scan based on 1. what is available in your environment 2. in the order your environment (nodejs, typescript) applies the resolution itself. However, if you want it to scan less you can specify so with the extensions attribute. E.g. when you're 100% sure you _only_ have typescript & json and nothing else you can pass ['.ts', '.json'] - which can lead to performance gains on systems with slow i/o (like ms-windows), especially when your tsconfig contains paths/ aliases.",
              "items": { "type": "string" }
            },
            "mainFields": {
              "type": "array",
              "description": "A list of main fields in manifests (package.json s). Typically you'd want to keep leave this this on its default (['main']) , but if you e.g. use external packages that only expose types, and you still want references to these types to be resolved you could expand this to ['main', 'types', 'typings']",
              "items": { "type": "string" }
            },
            "mainFiles": {
              "type": "array",
              "description": "A list of files to consider 'main' files, defaults to ['index']. Only set this when you have really special needs that warrant it."
            },
            "aliasFields": {
              "type": "array",
              "description": "A list of alias fields in manifests (package.jsons). Specify a field, such as browser, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). Also see [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealiasfields) in the webpack docs. Defaults to an empty array (don't use any alias fields).",
              "items": { "type": "string" }
            },
            "cachedInputFileSystem": {
              "type": "object",
              "description": "Options to pass to the resolver (webpack's 'enhanced resolve') regarding caching.",
              "additionalProperties": false,
              "properties": {
                "cacheDuration": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1800000,
                  "description": "The number of milliseconds [enhanced-resolve](webpack/enhanced-resolve)'s cached file system should use for cache duration. Typically you won't have to touch this - the default works well for repos up to 5000 modules/ 20000 dependencies, and likely for numbers above as well. If you experience memory problems on a (humongous) repository you can use the cacheDuration attribute to tame enhanced-resolve's memory usage by lowering the cache duration trading off against some (for values over 1000ms) or significant (for values below 500ms) performance. Dependency-cruiser currently uses 4000ms, and in the past has used 1000ms - both with good results."
                }
              }
            }
          }
        },
        "babelConfig": {
          "type": "object",
          "additionalProperties": false,
          "description": "Babel configuration (e.g. '.babelrc.json') to use.",
          "properties": {
            "fileName": {
              "description": "The Babel configuration file to use. The fileName is relative to dependency-cruiser's current working directory. When not provided defaults to './.babelrc.json'. Dependency-cruiser currently supports only the json variant. Support for (js|cjs|mjs) variants and configuration in package.json might follow in future releases.",
              "type": "string"
            }
          }
        },
        "parser": {
          "type": "string",
          "description": "overrides the parser dependency-cruiser will use - EXPERIMENTAL. The use of 'swc' as a parser here is deprecated.",
          "enum": ["acorn", "tsc", "swc"]
        },
        "exoticRequireStrings": {
          "type": "array",
          "description": "List of strings you have in use in addition to cjs/ es6 requires & imports to declare module dependencies. Use this e.g. if you've re-declared require (`const want = require`), use a require-wrapper (like semver-try-require) or use window.require as a hack to workaround something",
          "items": { "type": "string" }
        },
        "reporterOptions": { "$ref": "#/definitions/ReporterOptionsType" },
        "progress": {
          "type": "object",
          "additionalProperties": false,
          "description": "How dependency-cruiser shows progress. Defaults to 'none'.",
          "properties": {
            "type": {
              "type": "string",
              "enum": ["cli-feedback", "performance-log", "ndjson", "none"]
            },
            "maximumLevel": {
              "description": "The maximum log level to emit messages at. Ranges from OFF (-1, don't show any messages), via SUMMARY (40), INFO (50), DEBUG (60) all the way to show ALL messages (99).",
              "type": "number",
              "enum": [-1, 40, 50, 60, 70, 80, 99]
            }
          }
        },
        "metrics": {
          "type": "boolean",
          "description": "When this flag is set to true, dependency-cruiser will calculate (stability) metrics for all modules and folders. Defaults to false."
        },
        "experimentalStats": {
          "type": "boolean",
          "description": "When this flag is set to true, dependency-cruiser will calculate some stats for each module. Has some performance impact. EXPERIMENTAL Will be renamed when the 'experimental' state is lifted.Defaults to false."
        },
        "baseDir": {
          "type": "string",
          "description": "The directory dependency-cruiser should run its cruise from. Defaults to the current working directory."
        },
        "cache": {
          "oneOf": [
            { "type": "boolean" },
            { "deprecated": true, "type": "string" },
            { "$ref": "#/definitions/CacheOptionsType" }
          ],
          "description": "- false: don't use caching. \n- true or empty object: use caching with the default settings \n- a string (deprecated): cache in the folder denoted by the string & use the \n  default caching strategy. This is deprecated - instead pass a cache object \n  e.g. ```{ folder: 'your/cache/location' }```.\n\nDefaults to false (no caching).\nWhen caching is switched on the default cache folder is 'node_modules/.cache/dependency-cruiser/'"
        }
      }
    },
    "ModuleSystemType": {
      "type": "string",
      "enum": ["cjs", "es6", "amd", "tsd"]
    },
    "ModuleSystemsType": {
      "type": "array",
      "description": "List of module systems to cruise. Defaults to [amd, cjs, es6]",
      "items": { "$ref": "#/definitions/ModuleSystemType" }
    },
    "CompoundExcludeType": {
      "type": "object",
      "description": "Criteria for dependencies to exclude",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "a regular expression for modules to exclude from being cruised",
          "$ref": "#/definitions/REAsStringsType"
        },
        "dynamic": {
          "type": "boolean",
          "description": "a boolean indicating whether or not to exclude dynamic dependencies"
        }
      }
    },
    "CompoundDoNotFollowType": {
      "type": "object",
      "description": "Criteria for modules to include, but not to follow further",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "a regular expression for modules to include, but not follow further",
          "$ref": "#/definitions/REAsStringsType"
        },
        "dependencyTypes": {
          "type": "array",
          "description": "an array of dependency types to include, but not follow further",
          "items": { "$ref": "#/definitions/DependencyTypeType" }
        }
      }
    },
    "CompoundIncludeOnlyType": {
      "type": "object",
      "description": "Criteria for modules to only include",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
          "$ref": "#/definitions/REAsStringsType"
        }
      }
    },
    "CompoundFocusType": {
      "type": "object",
      "description": "Criteria for modules to 'focus' on",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
          "$ref": "#/definitions/REAsStringsType"
        },
        "depth": {
          "description": "by default 'focus' only inlcudes the direct neighbours of the focus'ed module(s). This property makes dependency-cruiser will also include neighbors of neighbors, up to the specified depth.",
          "type": "number",
          "minimum": 1,
          "maximum": 4
        }
      }
    },
    "CompoundReachesType": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "dependency-cruiser will include modules matching this regular expression in its output, as well as _any_ module that reaches them - either directly or via via",
          "$ref": "#/definitions/REAsStringsType"
        }
      }
    },
    "CompoundHighlightType": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "description": "dependency-cruiser will mark modules matching this regular expression as 'highlighted' in its output",
          "$ref": "#/definitions/REAsStringsType"
        }
      }
    },
    "ReporterOptionsType": {
      "type": "object",
      "description": "Options to tweak the output of reporters",
      "additionalProperties": false,
      "properties": {
        "anon": { "$ref": "#/definitions/AnonReporterOptionsType" },
        "archi": { "$ref": "#/definitions/DotReporterOptionsType" },
        "dot": { "$ref": "#/definitions/DotReporterOptionsType" },
        "ddot": { "$ref": "#/definitions/DotReporterOptionsType" },
        "flat": { "$ref": "#/definitions/DotReporterOptionsType" },
        "markdown": { "$ref": "#/definitions/MarkdownReporterOptionsType" },
        "metrics": { "$ref": "#/definitions/MetricsReporterOptionsType" },
        "mermaid": { "$ref": "#/definitions/MermaidReporterOptionsType" },
        "text": { "$ref": "#/definitions/TextReporterOptionsType" }
      }
    },
    "AnonReporterOptionsType": {
      "type": "object",
      "description": "Options to tweak the output of the anonymous reporter",
      "additionalProperties": false,
      "properties": {
        "wordlist": {
          "type": "array",
          "description": "List of words to use to replace path elements of file names in the output with so the output isn't directly traceable to its intended purpose. When the list is exhausted, the anon reporter will use random strings patterned after the original file name in stead. The list is empty by default. Read more in https://github.com/sverweij/dependency-cruiser/blob/main/doc/cli.md#anon---obfuscated-json",
          "items": { "type": "string" }
        }
      }
    },
    "MetricsReporterOptionsType": {
      "type": "object",
      "description": "Options to tweak the output of the metrics reporter",
      "additionalProperties": false,
      "properties": {
        "orderBy": {
          "type": "string",
          "enum": [
            "instability",
            "moduleCount",
            "afferentCouplings",
            "efferentCouplings",
            "name",
            "size",
            "topLevelStatementCount"
          ],
          "description": "By what attribute (in addition to the names of the folders/ modules) to order the metrics by. Defaults to 'instability'."
        },
        "hideModules": {
          "type": "boolean",
          "description": "When true hides module metrics from the report. Defaults to false"
        },
        "hideFolders": {
          "type": "boolean",
          "description": "When true hides folder metrics from the report. Defaults to false"
        }
      }
    },
    "MarkdownReporterOptionsType": {
      "type": "object",
      "description": "Options to show and hide sections of the markdown reporter and to provide alternate boilerplate text",
      "additionalProperties": false,
      "properties": {
        "showTitle": {
          "type": "boolean",
          "description": "Whether or not to show a title in the report. Defaults to true."
        },
        "title": {
          "type": "string",
          "description": "The text to show as a title of the report. E.g. '## dependency-cruiser forbidden dependency check - results'. When left out shows a default value."
        },
        "showSummary": {
          "type": "boolean",
          "description": "Whether or not to show a summary in the report. Defaults to true."
        },
        "showSummaryHeader": {
          "type": "boolean",
          "description": "Whether or not to give the summary a header. Defaults to true."
        },
        "summaryHeader": {
          "type": "string",
          "description": "The text to show as a header on top of the summary. E.g. '### Summary'. When left out shows a default value."
        },
        "showStatsSummary": {
          "type": "boolean",
          "description": "Whether or not to show high level stats in the summary. Defaults to true."
        },
        "showRulesSummary": {
          "type": "boolean",
          "description": "Whether or not to show a list of violated rules in the summary. Defaults to true."
        },
        "includeIgnoredInSummary": {
          "type": "boolean",
          "description": "Whether or not to show rules in the list of rules for which all violations are ignored. Defaults to true."
        },
        "showDetails": {
          "type": "boolean",
          "description": "Whether or not to show a detailed list of violations. Defaults to true."
        },
        "includeIgnoredInDetails": {
          "type": "boolean",
          "description": "Whether or not to show ignored violations in the detailed list. Defaults to true."
        },
        "showDetailsHeader": {
          "type": "boolean",
          "description": "Whether or not to give the detailed list of violations a header. Defaults to true."
        },
        "detailsHeader": {
          "type": "string",
          "description": "The text to show as a header on top of the detailed list of violations. E.g. '### All violations'. When left out shows a default value."
        },
        "collapseDetails": {
          "type": "boolean",
          "description": "Whether or not to collapse the list of violations in a <details> block. Defaults to true."
        },
        "collapsedMessage": {
          "type": "string",
          "description": "The text to in the <summary> section of the <details> block. E.g. 'click to see all violations'. When left out shows a default value."
        },
        "noViolationsMessage": {
          "type": "string",
          "description": "The text to show when no violations were found. E.g. 'No violations found'. When left out shows a default value."
        },
        "showFooter": {
          "type": "boolean",
          "description": "Whether or not to show a footer (with version & run date) at the bottom of the report. Defaults to true"
        }
      }
    },
    "MermaidReporterOptionsType": {
      "type": "object",
      "description": "Options to tweak the output of the mermaid reporters",
      "additionalProperties": false,
      "properties": {
        "minify": {
          "type": "boolean",
          "description": "Whether or not to compresses the output text. Defaults to true."
        }
      }
    },
    "TextReporterOptionsType": {
      "type": "object",
      "description": "Options that influence rendition of the text reporter",
      "additionalProperties": false,
      "properties": {
        "highlightFocused": {
          "type": "boolean",
          "description": "Whether or not to highlight modules that are focused with the --focus command line option (/ general option). Defaults to false"
        }
      }
    },
    "DotReporterOptionsType": {
      "type": "object",
      "description": "Options to tweak the output of the dot reporters",
      "additionalProperties": false,
      "properties": {
        "collapsePattern": {
          "description": "Regular expressions to collapse to. For the \"dot\" reporter defaults to null, but \"node_modules/[^/]+\" is recommended for most use cases.",
          "$ref": "#/definitions/REAsStringsType"
        },
        "filters": { "$ref": "#/definitions/ReporterFiltersType" },
        "showMetrics": {
          "description": "When passed the value 'true', shows instability metrics in the output if dependency-cruiser calculated them. Doesn't show them in all other cases. Defaults to false",
          "type": "boolean"
        },
        "theme": { "$ref": "#/definitions/DotThemeType" }
      }
    },
    "DotThemeType": {
      "type": "object",
      "description": "A bunch of criteria to conditionally theme the dot output",
      "additionalProperties": false,
      "properties": {
        "replace": {
          "type": "boolean",
          "description": "If passed with the value 'true', the passed theme replaces the default one. In all other cases it extends the default theme."
        },
        "graph": {
          "description": "Name- value pairs of GraphViz dot (global) attributes.",
          "type": "object"
        },
        "node": {
          "description": "Name- value pairs of GraphViz dot node attributes.",
          "type": "object"
        },
        "edge": {
          "description": "Name- value pairs of GraphViz dot edge attributes.",
          "type": "object"
        },
        "modules": {
          "description": "List of criteria and attributes to apply for modules when the criteria are met. Conditions can use any module attribute. Attributes can be any that are valid in GraphViz dot nodes.",
          "$ref": "#/definitions/DotThemeArrayType"
        },
        "dependencies": {
          "description": "List of criteria and attributes to apply for dependencies when the criteria are met. Conditions can use any dependency attribute. Attributes can be any that are valid in GraphViz dot edges.",
          "$ref": "#/definitions/DotThemeArrayType"
        }
      }
    },
    "DotThemeArrayType": {
      "type": "array",
      "items": { "$ref": "#/definitions/DotThemeEntryType" }
    },
    "DotThemeEntryType": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "criteria": { "type": "object" },
        "attributes": { "type": "object" }
      }
    },
    "ReporterFiltersType": {
      "type": "object",
      "description": "filters to apply to the reporter before rendering it (e.g. to leave out details from the graphical output that are not relevant for the goal of the report)",
      "additionalProperties": false,
      "properties": {
        "exclude": { "$ref": "#/definitions/CompoundExcludeType" },
        "includeOnly": { "$ref": "#/definitions/CompoundIncludeOnlyType" },
        "focus": { "$ref": "#/definitions/CompoundFocusType" },
        "reaches": { "$ref": "#/definitions/CompoundReachesType" }
      }
    },
    "ViolationsType": {
      "type": "array",
      "description": "A list of violations found in the dependencies. The dependencies themselves also contain this information, this summary is here for convenience.",
      "items": { "$ref": "#/definitions/ViolationType" }
    },
    "ViolationType": {
      "type": "object",
      "required": ["from", "to", "rule"],
      "additionalProperties": false,
      "properties": {
        "from": { "type": "string" },
        "to": { "type": "string" },
        "type": { "$ref": "#/definitions/ViolationTypeType" },
        "rule": { "$ref": "#/definitions/RuleSummaryType" },
        "cycle": {
          "type": "array",
          "items": { "$ref": "#/definitions/MiniDependency" },
          "description": "The circular path if the violation is about circularity"
        },
        "via": {
          "type": "array",
          "items": { "$ref": "#/definitions/MiniDependency" },
          "description": "The path from the from to the to if the violation is transitive"
        },
        "metrics": {
          "type": "object",
          "required": ["from", "to"],
          "additionalProperties": false,
          "properties": {
            "from": {
              "type": "object",
              "required": ["instability"],
              "additionalProperties": false,
              "properties": { "instability": { "type": "number" } }
            },
            "to": {
              "type": "object",
              "required": ["instability"],
              "additionalProperties": false,
              "properties": { "instability": { "type": "number" } }
            }
          }
        },
        "comment": {
          "type": "string",
          "description": "Free format text you can e.g. use to explain why this violation can be ignored or is quarantined (only used in _known-violations_) "
        }
      }
    },
    "RuleSummaryType": {
      "type": "object",
      "description": "If there was a rule violation (valid === false), this object contains the name of the rule and severity of violating it.",
      "required": ["name", "severity"],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "description": "The (short, eslint style) name of the violated rule. Typically something like 'no-core-punycode' or 'no-outside-deps'."
        },
        "severity": { "$ref": "#/definitions/SeverityType" }
      }
    },
    "ViolationTypeType": {
      "type": "string",
      "enum": [
        "dependency",
        "module",
        "reachability",
        "cycle",
        "instability",
        "folder"
      ]
    },
    "MiniDependency": {
      "type": "object",
      "description": "A small dependency object with the uniquely identifying name of the module +the dependency types it has relative to the _previous_ module in the chain  it is part of (e.g. a cycle).",
      "required": ["name", "dependencyTypes"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string", "description": "The name of the module" },
        "dependencyTypes": {
          "type": "array",
          "items": { "$ref": "#/definitions/DependencyTypeType" },
          "description": "The dependency types of the module relative to the previous module in the chain it is a part of (e.g. a cycle)"
        }
      }
    },
    "CacheOptionsType": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "folder": {
          "type": "string",
          "description": "The folder to store the cache in. Defaults to node_modules/.cache/dependency-cruiser"
        },
        "strategy": { "$ref": "#/definitions/CacheStrategyType" },
        "compress": {
          "type": "boolean",
          "description": "Whether to compress the cache or not\nSetting this to true will adds a few ms to the execution time, but\ntypically reduces the cache size by 80-90%.\n\nDefaults to false.",
          "default": false
        }
      }
    },
    "CacheStrategyType": {
      "type": "string",
      "description": "The strategy to use for caching.\n- 'metadata': use git metadata to detect changes;\n- 'content': use (a checksum of) the contents of files to detect changes.\n\n'content' is useful if you're not using git or work on partial clones (which is typical on CI's). Trade-of: the 'content' strategy is typically slower.\n\nDefaults to 'metadata'.",
      "enum": ["metadata", "content"]
    },
    "ExtendsType": {
      "description": "A configuration (or an array of configurations) this configuration uses as a base",
      "oneOf": [
        { "type": "string" },
        { "type": "array", "items": { "type": "string" } }
      ]
    }
  }
}