Eslint plugin with rules that will help you achieve a project structure that is scalable, consistent, and well thought out.
Playground for eslint-plugin-project-structure rules.
Become part of the community!
Leave a ⭐ and share the link with your friends.
If you have any questions click here, issues / an idea for a new functionality click here.
- Migration guide to 2.1.0.
- project-structure-folder-structure
- project-structure-independent-modules
- project-structure-naming-rules
Enforce rules on folder structure to keep your project consistent, orderly and well thought out.
✅ Validation of folder structure (Any files/folders outside the structure will be considered an error).
✅ File/Folders name regex validation.
✅ Build in case validation.
✅ Inheriting the parent's name (The child inherits the name of the folder in which it is located).
✅ Folder recursion (You can nest a given folder structure recursively).
✅ Accurate and detailed error messages even with multiple nested folders (recursion).
✅ Forcing a nested/flat structure for a given folder.
✅ Support for all file extensions.
A key principle of a healthy project is to prevent the creation of a massive dependency tree,
where removing or editing one feature triggers a chain reaction that impacts the entire project.
Create independent modules to keep your project scalable and easy to maintain.
Get rid of dependencies between modules and create truly independent functionalities.
✅ Creating independent modules in which you control what can be imported (e.g. types, functions, components of one functionality cannot be imported into another functionality).
✅ Disabling external imports (node_modules) for a given module (Option to add exceptions).
✅ Reference {dirname} which allows you to decide about the current directory and its level in the pattern.
✅ Reference {family} which finds the common part between a given import and the current file.
✅ Non-relative/relative imports support.
✅ Support for imports without extension.
✅ Reusable import patterns.
Enforce complex naming rules.
✅ Naming validation.
✅ Support for classes, types, interfaces, enums, variables, functions, arrow function.
✅ Naming rules only for name types located in the root of the file (not nested).
✅ Inheriting the file name as the name (Option of adding your own prefixes/suffixes or changing the case).
✅ Deleting parts of a file name.
✅ Different name rules for different files.
✅ Regex validation
✅ Build in case validation.