STRUCT012infoPro

naked-functions

Too many loose functions - consider grouping into a class or service.

Applies to: JavaScript, TypeScript

Why this matters

Files with many standalone functions become hard to navigate and maintain. Related functions should be grouped into classes or services that provide: clear responsibility boundaries, shared state/configuration, easier testing, and better discoverability. A BookingService class is clearer than 10 loose booking functions scattered in a file.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, STRUCT012 includedstablestack explain STRUCT012

STRUCT012 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: STRUCT012