lightsoutAlpha

server-functions

a server function living outside a `serverFns/` folder, or wrapped in a one-file folder it has not earned

Agent checkadvisory by defaulttanstackcode

The argument

Server Functions

Server functions live in a serverFns/ folder at feature or app level — the conventional domain folder for a feature's server calls, this pack's convention rather than TanStack's requirement. Each server function follows the graduation rule like everything else: a file by default, a folder only when it has private companions.

serverFns/
├── countIssuesServerFn.ts        # default: one file, no folder ceremony
└── findIssues/                   # graduated: it has a private companion
    ├── FindIssuesDocument.ts     #   the GraphQL document only it uses
    └── findIssuesServerFn.ts

A folder holding one server function and nothing else is ceremony the graduation rule forbids — the framework mandates nothing about this layout; the trigger for a folder is the companion file, never the category.

The proof

failsrc/features/issues/countIssues.ts
import { createServerFn } from '@tanstack/react-start';

// A server function loose in the feature root: nothing marks the server
// boundary, and its GraphQL document has nowhere to sit beside it.
export const countIssues = createServerFn().handler(async () => 0);
pass
export const CountIssuesDocument = 'query CountIssues { issues { totalCount } }';

Turn it down

Both lines go in your lightsout.config.json.

"standards-checks": { "server-functions": "advisory" }
"standards-checks": { "server-functions": "off" }