@zuke/lint-staged

← API reference

`@zuke/lint-staged` — typed `lint-staged` task wrappers for Zuke builds.

Symbols

#

LintStagedSettings

class
class LintStagedSettings extends ToolSettings

Settings for a lint-staged run.

MemberSignatureDoc
config config(path: PathLike): this Use an explicit config file (--config).
relative relative(): this Pass file paths relative to the working directory rather than absolute (--relative). Tools configured with root-relative globs — the usual case for an ESLint or Prettier config committed at the repo root — only match when the paths handed to them are relative too.
concurrent concurrent(tasks: number): this Run at most tasks linter tasks at once (--concurrent <n>). Use 1 to serialise them — what a tool that writes shared state (a cache, a lockfile) needs.
allowEmpty allowEmpty(): this Exit successfully when the tasks left nothing staged (--allow-empty). Without it a formatter that reverts the only staged change fails the run, because the resulting commit would be empty.
diff diff(ref: string): this Take the file list from a diff instead of the staged files (--diff <ref>), e.g. main...HEAD to lint everything a branch touched.
shell shell(): this Run the configured commands through a shell instead of parsing them (--shell).
#

LintStagedTasks

const
const LintStagedTasks: LintStagedTasksApi

Typed task functions for lint-staged.

#

LintStagedTasksApi

interface
interface LintStagedTasksApi

The shape of LintStagedTasks.

MemberSignatureDoc
run run(configure?: Configure<LintStagedSettings>): Promise<CommandOutput> Run the configured linters over the staged files: lint-staged.