Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: no-segmentless-slices with non-standard naming #44

Open
EliseyMartynov opened this issue Jun 25, 2024 · 3 comments
Open

Bug: no-segmentless-slices with non-standard naming #44

EliseyMartynov opened this issue Jun 25, 2024 · 3 comments

Comments

@EliseyMartynov
Copy link
Member

EliseyMartynov commented Jun 25, 2024

У нас на проекте нейминг сегментов использует в angular-like стиль:

cart.ui.tsx
cart.model.ts
cart.lib.ts
...

В некоторых местах где нет отдельных папок вроде 'ui', 'lib', и .тд. линтер ругается на то, что слайс без сегментов - что неверно.

Sandbox: https://codesandbox.io/p/devbox/steiger-test-g4f4wp

@illright
Copy link
Member

Yeah, these cases might be hard to catch, though this is technically non-standard FSD. How would you see a solution to support such cases?

@EliseyMartynov
Copy link
Member Author

Again, there are no hard restrictions to use segment-naming like that in the documentation. Segment part was always team-oriented thing.
E.g. our team uses "complicated" segments, where segment can contain its own sub-segments:

features
└─ slice
       └─ ui
              └─ segment-one
                     └─ index.ts
                     └─ segment-one.ui.tsx
                     └─ segment-one.model.ts 
              └─ segment-two.ui.tsx 

So I would suggest to process this cases out of the box (it could be some regex, and it's not crashing default behavior).

@uskov-anton
Copy link

I suggest adding the ability for users to specify the relationship between the segment type and the regexp in the settings.

Leave the current option as default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants