• English
  • lint

    The rs lint command uses Rslint to lint source code.

    Usage

    rs lint [options] [files...]

    The command loads the lint configuration registered with define.lint().

    Options

    rs lint supports the same command-line options as Rslint. See the Rslint CLI documentation for details.

    Examples:

    # Lint a specific directory
    rs lint src
    
    # Automatically fix problems
    rs lint --fix
    
    # Lint and run TypeScript type checking
    rs lint --type-check

    Configuration

    Configure linting through define.lint() in the Rstack configuration file. It accepts the standard Rslint configuration. Presets and plugins can be imported from rstack/lint on demand:

    rstack.config.ts
    import { define } from 'rstack';
    
    define.lint(async () => {
      const { js, ts } = await import('rstack/lint');
    
      return [js.configs.recommended, ts.configs.recommended];
    });