Skip to main content

Structurelint vs ls-lint vs eslint-plugin-project-structure

Three tools lint a JavaScript/TypeScript project's layout, and each answers a different question:

  • ls-lint: is every file and directory name in the right case?
  • eslint-plugin-project-structure: is the structure, and what imports what, right, inside ESLint?
  • Structurelint: may this file or folder exist here at all, and is everything required present?
structurelintls-linteslint-plugin-project-structure
What it validateswhich files and folders may exist at each levelfile and directory namesfolder structure, imports between modules, file contents
Required files and foldersyes, required: truecounts per directory with exists:Nyes, when a related file exists
Reusable and recursive rulesyes, with a recursion limitglob keys and parent-folder substitutionyes, with a depth limit
Needs ESLintnonoyes
Configstructure.config.ts (or .js, .mjs, .cjs).ls-lint.ymlESLint config

Which one to pick​

  • Only naming matters, across many languages, as a fast single binary: ls-lint.
  • The structure check should live inside ESLint, next to rules about imports between layers: eslint-plugin-project-structure.
  • The layout itself is the contract: every entry must be allowed by a rule, some must exist, and the result should be a clean gate for CI and AI coding agents outside the ESLint run: Structurelint.

Structurelint was extracted from an ESLint structure rule so the check runs in parallel with the rest of your tooling. It never scaffolds or generates code; it only reads what is on disk.

The same rule, two ways​

"Components are PascalCase .tsx files, and src/index.ts must exist":

// 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;

With Structurelint, a stray src/components/helper_old.js fails because no rule allows it, not only because of its case. ls-lint checks the names of the files that are there. See Rules for templates and recursion, and Recipes for full layouts.