One Binding Per Declaration
Write `const a = 1; const b = 2;` rather than `const a = 1, b = 2;`. One declaration per binding makes diffs cleaner, lets you initialise each from a different expression without contortions, and avoids the trap of accid…
$ prime install @web-style/rule-one-binding-per-declaration Projection
Always in _index.xml · the agent never has to ask for this.
OneBindingPerDeclaration [rule] v0.1.0
Write const a = 1; const b = 2; rather than const a = 1, b = 2;. One declaration per binding makes diffs cleaner, lets you initialise each from a different expression without contortions, and avoids the trap of accidentally giving every name in a comma-separated list the same const-vs-let modifier.
Loaded when retrieval picks the atom as adjacent / supporting.
OneBindingPerDeclaration [rule] v0.1.0
Write const a = 1; const b = 2; rather than const a = 1, b = 2;. One declaration per binding makes diffs cleaner, lets you initialise each from a different expression without contortions, and avoids the trap of accidentally giving every name in a comma-separated list the same const-vs-let modifier.
Checks
- No
const a = 1, b = 2patterns — each binding is its own statement. - ESLint
one-varrule set to["error", "never"](or equivalent). - Destructuring counts as one binding for this rule:
const { a, b } = objis fine, since the source is a single expression.
Label
Declare one binding per const or let statement
Loaded when retrieval picks the atom as a focal / direct hit.
OneBindingPerDeclaration [rule] v0.1.0
Write const a = 1; const b = 2; rather than const a = 1, b = 2;. One declaration per binding makes diffs cleaner, lets you initialise each from a different expression without contortions, and avoids the trap of accidentally giving every name in a comma-separated list the same const-vs-let modifier.
Checks
- No
const a = 1, b = 2patterns — each binding is its own statement. - ESLint
one-varrule set to["error", "never"](or equivalent). - Destructuring counts as one binding for this rule:
const { a, b } = objis fine, since the source is a single expression.
Label
Declare one binding per const or let statement
Label
Declare one binding per const or let statement
Source
prime-system/examples/web-style/primes/compiled/@web-style/rule-one-binding-per-declaration/atom.yaml