You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title says it all. With the notable exception of the ui/ directory (used by shadcn-ui), the overall structure has always been to define a non-default exported "public" component from an index.tsx that is located in a directory with camel casing. Ex: TransactionsTable is exported from components/TransactionsTable/index.tsx. This was simply the pattern chosen at the time and, overall, has worked just fine. It gives a top level directory that is easy to ID quickly for imports, prevents confusing/accidental default export aliasing, and gives the illusion of "private" component modules (anything not in index.tsx is not supposed to be used directly).
Update everything to fit this pattern again. Adding an eslint rule to enforce the model would be ideal, too.
The text was updated successfully, but these errors were encountered:
Summary
Title says it all. With the notable exception of the
ui/
directory (used byshadcn-ui
), the overall structure has always been to define a non-default exported "public" component from anindex.tsx
that is located in a directory with camel casing. Ex:TransactionsTable
is exported fromcomponents/TransactionsTable/index.tsx
. This was simply the pattern chosen at the time and, overall, has worked just fine. It gives a top level directory that is easy to ID quickly for imports, prevents confusing/accidental default export aliasing, and gives the illusion of "private" component modules (anything not inindex.tsx
is not supposed to be used directly).Update everything to fit this pattern again. Adding an eslint rule to enforce the model would be ideal, too.
The text was updated successfully, but these errors were encountered: