constant-casing
How a constant's name is cased.
Agent checkAdvises by default
The rule
Agents read this text as written when they write and review code.
Name a const object that shares its name with its type in PascalCase, such as Action. Name every other constant in camelCase: a single value such as maxRetries, or an object that groups related values such as featureThresholds.
Examples
The agent flags code like the incorrect example and accepts code like the correct one.
Incorrect
// Incorrect: a single value named in upper case.export const retrySync = (): number => {const MAX_RETRIES = 3;return MAX_RETRIES;};
Correct
// Correct: a single value is camelCase.export const retrySync = (): number => {const maxRetries = 3;return maxRetries;};
Configure
- Block
"blocking"Stops a run when a file the run changed breaks the rule. - AdviseDefault
"advisory"Reports it and hands it to the refactor agent. Never stops a run. - Off
"off"Not checked. Use it when your own linter already enforces the rule.
Add this to your lightsout.config.json, then change the value.
{"standards-rule-settings": {"constant-casing": "advisory"}}