Default Parameters Not Mutate Args
Express defaults in the parameter list with `=`. Do not patch missing values inside the body with reassignment, `||`, or by writing into `arguments`.…
$ prime install @web-style/rule-default-parameters-not-mutate-args Projection
Always in _index.xml · the agent never has to ask for this.
DefaultParametersNotMutateArgs [rule] v0.1.0
Express defaults in the parameter list with =. Do not patch missing values inside the body with reassignment, ||, or by writing into arguments. Default-parameter syntax keeps the function signature self-documenting and makes the default value visible at the call boundary.
Loaded when retrieval picks the atom as adjacent / supporting.
DefaultParametersNotMutateArgs [rule] v0.1.0
Express defaults in the parameter list with =. Do not patch missing values inside the body with reassignment, ||, or by writing into arguments. Default-parameter syntax keeps the function signature self-documenting and makes the default value visible at the call boundary.
Checks
- Defaults are written
function fn(x = 0, y = []) { … }, notif (x === undefined) x = 0. - No reads of or writes to the
argumentsobject — use rest parameters instead:function fn(...args). - Default-valued parameters come last in the signature so callers can omit them positionally.
- Default expressions are not side-effectful; they evaluate per call.
Label
Use ES6 default parameters; never mutate the arguments object
Loaded when retrieval picks the atom as a focal / direct hit.
DefaultParametersNotMutateArgs [rule] v0.1.0
Express defaults in the parameter list with =. Do not patch missing values inside the body with reassignment, ||, or by writing into arguments. Default-parameter syntax keeps the function signature self-documenting and makes the default value visible at the call boundary.
Checks
- Defaults are written
function fn(x = 0, y = []) { … }, notif (x === undefined) x = 0. - No reads of or writes to the
argumentsobject — use rest parameters instead:function fn(...args). - Default-valued parameters come last in the signature so callers can omit them positionally.
- Default expressions are not side-effectful; they evaluate per call.
Label
Use ES6 default parameters; never mutate the arguments object
Label
Use ES6 default parameters; never mutate the arguments object
Source
prime-system/examples/web-style/primes/compiled/@web-style/rule-default-parameters-not-mutate-args/atom.yaml