• English
  • staged

    The rs staged command uses lint-staged to run tasks against files staged in Git.

    A common use case is to run linters, formatters, or other checks on staged files before committing code.

    Usage

    rs staged [options]

    The command loads the staged-file tasks registered with define.staged().

    Options

    --allow-empty

    --allow-empty allows an empty commit when tasks revert all staged changes.

    rs staged --allow-empty

    --concurrent

    --concurrent (or -p) sets how many tasks run concurrently; use false to run them serially.

    rs staged --concurrent false

    --cwd

    --cwd sets the working directory used to run all tasks.

    rs staged --cwd packages/app

    --debug

    --debug (or -d) prints additional debug information.

    rs staged --debug

    --no-stash

    --no-stash disables the backup stash and automatic reversion when a task fails.

    rs staged --no-stash

    --quiet

    --quiet (or -q) disables lint-staged's own console output.

    rs staged --quiet

    --relative

    --relative (or -r) passes file paths relative to the working directory to tasks.

    rs staged --relative

    --verbose

    --verbose (or -v) shows task output even when tasks succeed; by default, only output from failed tasks is displayed.

    rs staged --verbose

    --help

    --help (or -h) displays the command's usage and options.

    rs staged --help

    Configuration

    Configure staged-file tasks through define.staged() in the Rstack configuration file. It accepts the standard lint-staged configuration:

    rstack.config.ts
    import { define } from 'rstack';
    
    define.staged({
      '*.{js,jsx,ts,tsx}': 'rs lint',
    });