Brought to you by Allons-y Studio

Type Alias: DetectorContext

type DetectorContext = {
  branch: string;
  config: OpxConfig;
  cwd: string;
  dryRun: boolean;
  fileTypes: Set<string>;
  fix: boolean;
  hostPkg: PackageJson;
  logger: Logger;
  pkgManager: PackageManager;
  state: OpxState;
  write: void;
};

Defined in: detector.ts:91

What a detector is given: the project, its settings, and how to report.

Properties

Property Type Description Defined in
branch string The current git branch. detector.ts:105
config OpxConfig The parsed .opx/config.json. detector.ts:101
cwd string The repository root. detector.ts:93
dryRun boolean Whether to report what would change without changing it. detector.ts:109
fileTypes Set<string> File extensions found in the committed tree, with the leading dot. detector.ts:95
fix boolean Whether the tool should fix problems it can fix. detector.ts:111
hostPkg PackageJson The host project's package.json. detector.ts:97
logger Logger Where to send log messages. detector.ts:107
pkgManager PackageManager The host project's package manager. detector.ts:99
state OpxState The parsed .opx/state.json. detector.ts:103

Methods

write()

write(chunk): void;

Defined in: detector.ts:118

Sink for a detector's primary (report) output — e.g. an ESLint results report. Defaults to stdout, but the CLI may swap in a buffer so concurrent detectors' output can be flushed grouped instead of interleaved. Use this instead of writing to process.stdout directly.

Parameters

Parameter Type
chunk string

Returns

void