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

Add an exception for an index file inside the App layer #55

Closed
daniilsapa opened this issue Jul 13, 2024 · 4 comments · Fixed by #57
Closed

Add an exception for an index file inside the App layer #55

daniilsapa opened this issue Jul 13, 2024 · 4 comments · Fixed by #57
Assignees
Labels
good first issue Good for newcomers TYPE | enhancement New feature or request

Comments

@daniilsapa
Copy link
Contributor

daniilsapa commented Jul 13, 2024

Right now it reports an error on such a case. But it looks like it should not, because the app layer is the entry point to your application, and it's pretty intuitive that it could have an index.js/ts file.

Screenshot 2024-07-13 at 23 35 16
@illright
Copy link
Contributor

Why not app/entrypoint?

@daniilsapa
Copy link
Contributor Author

@illright
Just my personal opinion on this point.

1. How do the users usually name their entry point file?

I reviewed examples from FSD examples page to see what people usually use.

The results are:

  • 32 projects
  • 3 do not really meet the FSD structure, so I didn’t count them
  • 18 have index.js/ts in the App layer
  • 11 have entry files of other names

So, the users tend to have index files there.

2. Unnecessary limitation

I understand that an architectural approach for software is partially about well-thought restrictions that you create for yourself that help you structure things. But I personally believe that restrictions should be applied where they are critical, and should not create additional headaches where they are absolutely unnecessary.

3. Resistance to integration

When you see an error from your linter, it takes time to understand what is wrong and why. Then you need to decide what to do. In the case we’re discussing, it can be renaming the file or disabling the rule.

This project is still in its early stages so far and I think it is worth reducing resistance to integration as much as possible and the number of such small headaches to a minimum to grow the user base quicker. The more such small things that can annoy users the more chance that another such a small thing can be the last straw where a user decides to abandon/disable the tool.

If this still doesn't sound convincing, feel free to close the issue.

@illright
Copy link
Contributor

No, these are good points. Besides, this is not the first time we make exceptions for the App layer. I'm convinced, we can add this exception. Feel free to make another PR :)

@daniilsapa
Copy link
Contributor Author

Got it, sure, I'll add logic to handle this exception and make a PR soon 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers TYPE | enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants