Skip to content

No Shape in Symbol Names

Error
small-rules/no-shape-in-symbol-names

Disallow the case-insensitive substring "shape" in JavaScript, TypeScript, private, and JSX symbol names.

Rationale

Ported from dmmulroy/anti-slop. shape describes structure, not the domain responsibility a symbol owns. Name the user, command, payload, or other real concept instead.

Diagnostic Messages

forbiddenSymbolName
Rename symbol "{{name}}" for its domain role; "shape" describes structure rather than ownership.

Configuration

This rule does not accept options.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/no-shape-in-symbol-names": "error"
}
}

Examples

'shape' in a TypeScript symbol
interface UserShape { id: string }
domain-named symbol
interface User { id: string }