Registry / testing / structlint

structlint

JSON →
library1.0.0-beta.1jsnpmunverified

Lint your project structure against architecture rules. Currently at version 1.0.0-beta.1 with no stable release yet and uncertain release cadence. Defines allowed and disallowed imports per directory using glob patterns in .structlintrc configs. Differentiates by enabling per-folder configs and recursive linting, acting as an 'ESLint for folder structure'.

npm install structlint
INSTALL
IMPORT
SIG · STRUCTLINT
S
structlint
testingjavascriptv1.0.0-beta.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

structlint
npx structlint
structlint
Use npx to avoid global install.

Installs structlint, creates a config disallowing tests imports in src/, then runs lint.

npm install --save-dev structlint echo '{"structure":[{"path":"./src","disallowedImports":["./tests/**/*"]}]}' > .structlintrc mkdir -p src tests npx structlint
structlint --version
Debug
Known issues
gotchaBeta version: API may change in future releases.
fix
Pin version and test before upgrading.
affects: 1.0.0-beta.1
gotchaConfigs in subdirectories are relative to their own location.
fix
Always use paths relative to the .structlintrc file location.
affects: >=1.0.0-beta.1
gotchaRecursive linting is enabled by default; may cause performance issues on large projects.
fix
Set recursive: false in config if only top-level is needed.
affects: >=1.0.0-beta.1
Errors
Common errors & fixes
structlint: command not found
Global install not done or not in PATH.
fix
Run npx structlint instead, or install globally: npm install -g structlint
TypeError: Cannot read property 'structure' of undefined
Missing or malformed .structlintrc file.
fix
Create a .structlintrc file with a 'structure' array.
Upgrade
Version history
1.0.0-beta.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
structlint — npm install structlint · libregistry