lightsoutAlpha

banned-folder-name

Folder names that say nothing about what the folder holds.

Deterministic checkAgent checkAdvises by default

The rule

Agents read this text as written when they write and review code.

Name a folder for its subject, such as billing/ or formatting/, never for the kind of code it holds.

  • utils/, services/, helpers/, lib/, core/, misc/, shared/ and internal/ are never folder names.
  • types/ and constants/ are folder names only at the top of a common/.

A name that says nothing about what a folder holds draws code nobody placed, and common/ is the only folder name with a meaning of its own.

Examples

The check flags the incorrect code and passes the correct code; the agent judges what the check cannot see. Each example is a small repo, because this rule looks across files. It opens on the file that matters; the other files are the repo around it.

Incorrect

srcbillinghelpersinvoicestypes
src/billing/helpers/formatAmount.ts
export const formatAmount = () => 1;

Correct

srcbillingcommontypesinvoices
src/billing/common/types/Invoice.ts
export interface Invoice {
id: string;
}

Configure

  • Block"blocking"Stops a run when a file the run changed breaks the rule.
  • Advise"advisory"Reports it and hands it to the refactor agent. Never stops a run.
    Default
  • 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.

lightsout.config.json
{
"standards-rule-settings": {
"banned-folder-name": "advisory"
}
}

Packs that select it