Skip to content

Eslint plugin with rules that will help you achieve a project structure that is scalable, consistent, and well thought out. Whether you're working alone, with a small or large team, save time by automating the reviews of key principles for a healthy project!

License

Notifications You must be signed in to change notification settings

Igorkowalski94/eslint-plugin-project-structure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-project-structure

Eslint plugin with rules that will help you achieve a project structure that is scalable, consistent, and well thought out.
Whether you're working alone, with a small or large team, save time by automating the reviews of key principles for a healthy project!

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 or need help creating a configuration that meets your requirements click here, issues / an idea for a new functionality click here.

Documentation:

Rules:

Enforce rules on folder structure to keep your project consistent, orderly and well thought out.

Features:

✅ Validation of folder structure. Any files/folders outside the structure will be considered an error.
✅ File/Folder name regex validation with features like wildcard * and treating . as a character, along with other conveniences.
✅ Build in case validation.
✅ Inheriting the folder's name. The file/folder inherits the name of the folder in which it is located. Option of adding your own prefixes/suffixes or changing the case.
✅ Enforcing the existence of a files/folders when a specific file/folder exists. For example, if ./src/Component.tsx exists, then ./src/Component.test.tsx and ./src/stories/Component.stories.tsx must also exist.
✅ Reusable rules for folder structures.
✅ An option to create a separate configuration file with TypeScript support.
✅ Forcing a nested/flat structure for a given folder.
✅ Support for all file extensions.
✅ Folder recursion. You can nest a given folder structure recursively.
✅ Fewer repetitions and precise error messages, even for deeply nested folders (recursion), by representing the folder structure as a tree.

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.

Features:

✅ 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).
✅ Non-relative/relative imports support.
✅ Support for imports without extension.
✅ Reusable import patterns.
✅ Support for path aliases. The plugin will automatically detect your tsconfig.json and use your settings. There is also an option to enter them manually.
✅ An option to create a separate configuration file with TypeScript support.

Enforce complex naming rules.

Features:

✅ Naming validation.
✅ Supported name types: Classes, types, interfaces, enums, variables, functions, arrow function.
✅ Naming rules only for name types located in the root of the file (not nested).
✅ Naming rules only for exported name types.
✅ Inheriting the filename as the name. Option of adding your own prefixes/suffixes, changing the case or deleting parts of a filename.
✅ Enforcing a maximum of one main function/class per file.
✅ Different name rules for different files.
✅ Regex validation.
✅ Build in case validation.
✅ An option to create a separate configuration file with TypeScript support.