A TypeScript-first library for validating and generating directory structures based on schema definitions. Current stable version is 2.0.3, with a regular release cadence. Key differentiators include zero dependencies, full TypeScript support, pattern matching with wildcards and regex, and a pluggable backend system. It supports two schema types: ValidateSchema for checking existing structures and GenerateSchema for creating them. Unlike similar tools, it focuses on schema-driven, programmatic validation rather than config-file-based linting, making it suitable for integration into build pipelines or scaffolding tools.
npm install directory-lintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to validate a directory structure against a schema using DirectoryLint.validate() with ignore patterns.
Remove any previously passed options; use validate/generate options instead.
Switch to ES modules or use dynamic import() if you must use CommonJS.
Replace all calls to .lint() with .validate().
Remove custom backend option; the library now includes a built-in filesystem backend.
Ensure case matches filesystem. For case-insensitive matching, use regex patterns.
Provide correct base path; the library does not resolve relative to cwd automatically.
Use import statement or dynamic import('directory-lint') instead of require().Use 'import { DirectoryLint } from "directory-lint"' instead of default import.Use 'import type { ValidateSchema } from "directory-lint"'.No dependency data recorded yet.