# vite => vite dev (handles all cases: with/without env var prefix and flag args)
# Match command_name to preserve env var prefix and arguments
# Excludes subcommands like "vite build", "vite test", etc.
---
id: replace-vite
language: bash
rule:
  kind: command_name
  regex: '^vite$'
  inside:
    kind: command
    not:
      # ignore non-flag arguments (subcommands like build, test, etc.)
      regex: 'vite\s+[^-]'
fix: vite dev

# oxlint => vite lint (handles all cases: with/without env var prefix and args)
# Match command_name to preserve env var prefix and arguments
---
id: replace-oxlint
language: bash
rule:
  kind: command_name
  regex: '^oxlint$'
fix: vite lint

# oxfmt => vite fmt
---
id: replace-oxfmt
language: bash
rule:
  kind: command_name
  regex: '^oxfmt$'
fix: vite fmt

# vitest => vite test
---
id: replace-vitest
language: bash
rule:
  kind: command_name
  regex: '^vitest$'
fix: vite test

# tsdown => vite lib
---
id: replace-tsdown
language: bash
rule:
  kind: command_name
  regex: '^tsdown$'
fix: vite lib
