Using eslint-plugin-project-structure to automate FSD project structure review #625
Replies: 1 comment 5 replies
-
Hey Igor, interesting project! Does it support restriction on imports, or are there plans to support that? This would be the most important thing to check automatically when considering the validity of an FSD project. As for creating a structure for FSD, I'm not sure that would be possible or very useful, since FSD doesn't impose any restrictions on file names or on positions of the FSD roots in your project. For example, all of these are valid FSD:
With segments there are also not many restrictions, you can use the standard |
Beta Was this translation helpful? Give feedback.
-
Hey, I think you might be interested in my new eslint plugin. You can fully automate the review of project structure rules for FSD and make it available to the community.
eslint‑plugin-project‑structure
ESLint plugin with rules to help you achieve a scalable, consistent, and well-structured project.
Create your own framework! Define your folder structure, advanced naming conventions, file composition, and create independent modules.
Take your project to the next level and save time by automating the review of key principles of a healthy project!
project‑structure/folder‑structure
Enforce rules on folder structure to keep your project consistent, orderly and well thought out.
*
and treating.
as a character, along with other conveniences../src/Component.tsx
exists, then./src/Component.test.tsx
and./src/stories/Component.stories.tsx
must also exist.project‑structure/independent‑modules
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.
project‑structure/file‑composition
Enforce advanced naming rules and prohibit the use of given selectors in a given file.
Have full control over what your file can contain and the naming conventions it must follow.
class
,function
,arrowFunction
,type
,interface
,enum
,variable
,variableCallExpression
,variableTaggedTemplateExpression
.**/*.consts.ts
files can only contain variables,**/*.types.ts
files can only contain enums, interfaces and types.Beta Was this translation helpful? Give feedback.
All reactions