vtcode 0.123.7

A Rust-based terminal coding agent with modular architecture supporting multiple LLM providers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
id: prefer-readonly
language: typescript
severity: hint
message: Use `readonly` arrays for return types that should not be mutated.
note: |
  Returning mutable arrays allows callers to modify internal state
  accidentally. Use `readonly $T[]` or `ReadonlyArray<T>` to signal
  that the array should not be mutated. This improves API contracts
  and prevents unintended side effects.
rule:
  any:
    - pattern: "(): $T[]"
    - pattern: "(): Array<$T>"
files:
  - "**/*.ts"
  - "**/*.tsx"
  - "!**/*.d.ts"