Structurelint
Structurelint checks an existing project's files and folders against rules you define, and reports every entry no rule allows and every required one that is missing. It is a CLI and a JavaScript API, it does not need ESLint, and it never scaffolds or generates code: it only reads what is on disk.
Content is verified against
@ladamczyk/structurelintv1.1.6. SeeCHANGELOG.mdto verify accuracy.
Why
Folder structure is architecture, and code review is a poor place to enforce it. AI coding agents make it harder still: they create files wherever the task is easiest. Describe the layout once as rules, and every run, local, in CI or after an agent's change, fails on a stray utils2.ts or a component without its index.ts.
// structure.config.ts
import type { IStructureConfig } from '@ladamczyk/structurelint';
export default {
structureRoot: 'src',
structure: [
{ name: 'index.ts', required: true },
{ name: 'components', children: [{ name: '{PascalCase}.tsx' }] },
],
} satisfies IStructureConfig;
Rules are recursive: a rule can reference itself or other named rules to describe nested structures, such as components/Button/nested/Icon, where nested reuses the same PascalCase component rules as the root components. See Rules.
Installation
npm install --save-dev @ladamczyk/structurelint
npx structurelint
Or run it directly without installing:
npx @ladamczyk/structurelint
It needs Node ^22.22.2, ^24.15.0 or >=26 and npm 10 or later. .ts configs also need typescript in your project.
Compared with similar tools
ls-lint checks file and directory names; eslint-plugin-project-structure checks folder structure and imports inside ESLint. Structurelint checks which entries may exist at each level and which are required, outside ESLint. See Structurelint vs ls-lint vs eslint-plugin-project-structure.
Next steps
- Configuration and Rules: describe your layout.
- Recipes: ready-made layouts for React, Next.js App Router and monorepos.
- Command line: exit codes and
--json. - AI agents and CI: use it as a gate, with an
AGENTS.mdsnippet. - qoq integration: run it inside
qoq --check.
Changelog
Release history lives in the repo — Releases and CHANGELOG.md.