Menu

How to enforce folder boundaries with Eslint
πŸ“°

How to enforce folder boundaries with Eslint

DEV Community: typescriptΒ·Jakub AndrzejewskiΒ·about 14 hours ago
#qQsM5lk8
#devtotypescript#devto#dev#type#boundaries
Reading 0:00
15s threshold

Hey folks!

Today I wanted to talk to you about Frontend Architecture and more specifially how you can enforce folder boundaries with Eslint - a tool we usually think is only for making sure we have correct amount of spaces.

Enjoy!

Problem

When a project grows, it is very easy to introduce unwanted cross module dependencies .

Such dependencies will make it much more difficult in the future to touch certain areas as making changes to one place will eventually affect other places.

In FE, a popular circular dependency is something like following:

components β†’ composables β†’ components

Enter fullscreen mode

Exit fullscreen mode

Solution

One solution could be using Dependency Cruiser from my previous article but you can also utilize an Eslint rule that will warn you about these dependency issues in your IDE while you are writing code.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.