Skip to main content
StackProbe can be configured using a stackprobe.config.js file in your project root. This allows you to customize which checks run, how failures are handled, and more.

Creating a Config File

Create a stackprobe.config.js file in the root of your project:
stackprobe.config.js
/** @type {import('stackprobe').StackProbeConfig} */
module.exports = {
  ignore: [],
  failOn: "error",
};
The JSDoc type annotation provides autocomplete support in VS Code and other editors.

Configuration Options

StackProbe uses the StackProbeConfig interface defined below:
interface StackProbeConfig {
  ignore?: string[];        // check names to skip
  only?: string[];          // run ONLY these checks
  failOn?: "warn" | "error"; // default: error only
}

ignore

ignore
string[]
default:"[]"
List of check names to skip during the audit.Available checks:
  • license - License compatibility check
  • env - Environment variable validation
  • deps - Dependency analysis
  • engine - Node.js engine version check
  • circular - Circular dependency detection
Example:
module.exports = {
  ignore: ['license', 'circular'],
};

only

only
string[]
Run ONLY these specific checks. When set, this overrides the ignore option.Available checks:
  • license - License compatibility check
  • env - Environment variable validation
  • deps - Dependency analysis
  • engine - Node.js engine version check
  • circular - Circular dependency detection
Example:
module.exports = {
  only: ['deps', 'env'],
};

failOn

failOn
'warn' | 'error'
default:"'error'"
Determines when StackProbe should exit with a non-zero status code in CI environments.
  • error (default) - Exit with code 1 only on errors
  • warn - Exit with code 1 on warnings and errors
Example:
module.exports = {
  failOn: 'warn',
};

Full Example

stackprobe.config.js
/** @type {import('stackprobe').StackProbeConfig} */
module.exports = {
  // Skip license and circular dependency checks
  ignore: ['license', 'circular'],

  // Fail on both warnings and errors
  failOn: 'warn',
};

Running Specific Checks

To run only dependency and environment checks:
stackprobe.config.js
/** @type {import('stackprobe').StackProbeConfig} */
module.exports = {
  only: ['deps', 'env'],
};

Default Configuration

If no config file is present, StackProbe uses these defaults:
{
  ignore: [],
  failOn: 'error',
}

Config Loading

StackProbe looks for stackprobe.config.js in the current working directory. If the file cannot be loaded or parsed, a warning is shown and default values are used:
⚠  Could not load stackprobe.config.js — using defaults

Build docs developers (and LLMs) love