Folder Lint

raw JSON →
1.0.5 verified Fri May 01 auth: no javascript

A library for linting folder structures, currently at version 1.0.5. Designed to enforce directory conventions in projects using custom rules. Differentiates from standard linters by focusing on file system layout rather than code style. Latest release is stable, with no recent updates. The package ships TypeScript types for use in TS projects. It is a small utility primarily configured via Node.js scripts.

error Cannot find module 'folder-lint'
cause Package not installed or import path incorrect.
fix
Run 'npm install folder-lint' and ensure import matches version syntax.
gotcha Rule names are case-insensitive but use kebab-case in documentation; mixing case may cause unexpected behavior.
fix Always use kebab-case for rule names (e.g., 'no-nested-dist').
npm install folder-lint
yarn add folder-lint
pnpm add folder-lint

Demonstrates basic usage: check current directory against a custom rule that disallows nested 'dist' folders.

import folderLint from 'folder-lint';

const result = folderLint.checkStructure('.', {
  rules: {
    'no-nested-dist': true,
  },
});

if (result.errors.length > 0) {
  console.error('Folder structure violation:', result.errors);
} else {
  console.log('Structure OK');
}