Skip to content

structure/lone-files

Finds a folder that holds one code file and nothing else.

Part of the structure configuration, at the all level. It runs at the commit stage, once per scope. gspot runs this check itself.

A folder with one file adds a level to every import path and groups nothing.

Move the file up beside its neighbors, or use gspot ignore structure/lone-files with paths and a reason.

With TypeScript at level all, a feature/only.ts alone in its folder reports lone-file. Move it up beside related code, and update its imports.

Turn it off for some files, with a reason:

gspot ignore structure/lone-files --paths "<glob>" --reason "<why>"