lightsoutAlpha

file-naming-conventions

a React file whose name does not carry the casing its kind mandates

Agent checkadvisory by defaultreactcode

The argument

File Naming Conventions

The filename-match rule applied to React exports — a file is named for what it exports, in that export's own casing — plus the folder-casing rule for folders. The table below is derived from those two rules, not a separate law:

File holdsSo its name isExample
A component (PascalCase export)PascalCase.tsxIssueDetailContent.tsx
A hook (useX export)camelCase.tsuseIssues.ts, useUpdateIssue.ts
A util (camelCase export)camelCase.tsbuildOrderBy.ts, formatDate.ts
An interface or named-constant objectPascalCase.tsQueryKey.ts, FilterOption.ts
A plain constantcamelCase.tsemailRegex.ts, defaultPaginationPage.ts
A category foldercamelCase/components/, hooks/, queries/
A graduated component folderthat component's PascalCase/IssueDetail/, IssueHeaderToolbar/

.tsx for a file containing JSX is TypeScript's requirement, not a React mandate — React itself names nothing.

The proof

fail
interface Props {
	title: string;
}

// A component file in kebab-case with no framework mandating it — the name has
// to carry the export's own PascalCase.
export const IssueDetailContent = ({ title }: Props) => <h1>{title}</h1>;
pass
interface Props {
	title: string;
}

export const IssueDetailContent = ({ title }: Props) => <h1>{title}</h1>;

Turn it down

Both lines go in your lightsout.config.json.

"standards-checks": { "file-naming-conventions": "advisory" }
"standards-checks": { "file-naming-conventions": "off" }