Registry / testing / lint-fs

lint-fs

JSON →
library1.2.10jsnpmunverified

A tool to lint file system structures using regular expressions, enabling enforcement of directory and file naming conventions and project layout rules. Current stable version is 1.2.10, released in early 2023 with ongoing minor updates. It uses a YAML configuration file (lint-fs.yaml) and runs via npx. Differentiates from other linters by focusing on file system structure rather than code content, supporting ECMAScript regex patterns for flexible rules.

npm install lint-fs
INSTALL
IMPORT
SIG · LINT-FS
L
lint-fs
testingjavascriptv1.2.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Install lint-fs, create a basic YAML config to enforce lowercase directory names in src/, and run the linter.

npm install --save-dev lint-fs # Create lint-fs.yaml in project root: # rules: # enforce-dir-case: # pattern: "^[a-z]+$" # path: "src/**" # description: "Directories must be lowercase" # Run: npx lint-fs
Debug
Known issues
gotchaConfiguration file must be named lint-fs.yaml exactly and placed in project root.
fix
Rename your config file to lint-fs.yaml or use --config option if supported.
affects: >=1.0.0
gotchaRegular expressions are applied against full relative paths from project root, not just file/directory names.
fix
Adjust regex patterns to match the full path (e.g., ^src/[a-z]+$ for directories under src).
affects: >=1.0.0
gotchaNode engine requirement is 18.14.2 or higher, npm 9.5.0+. Older Node versions will fail to install or run.
fix
Update Node.js to v18.14.2+ and npm to v9.5.0+.
affects: >=1.0.0
gotchaPackage is CLI-only; there is no programmatic API for use within Node.js scripts.
fix
Use child_process.exec('npx lint-fs') if integration is needed.
affects: >=1.0.0
Errors
Common errors & fixes
Error: No configuration file found. Expected lint-fs.yaml in project root.
Missing or misnamed configuration file.
fix
Create a lint-fs.yaml file in your project's root directory with valid rules.
Error: Invalid regex pattern in rule 'xyz': / ... /
Malformed regular expression in configuration.
fix
Provide a valid ECMAScript regex string in the pattern field (e.g., '^[a-z]+$').
Error: require() of ES modules is not supported.
Attempting to use the package as a CommonJS module.
fix
Use the CLI via npx, not require(). The package is an ES module.
Upgrade
Version history
1.2.10latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
lint-fs — npm install lint-fs · libregistry