1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/website/docs/contributing/ADRs/front-end/interface-naming.md
Fredrik Strand Oseberg ad7c139992
fix: add ADR for domain language (#2541)
This PR puts our contributing guidelines in the sidebar of the unleash
documentation. Currently there was no way of navigating to them easily,
which made our contribution guides and ADRs less useful. This PR adds
them to the sidebar as their own category, and adds an ADR for domain
centric language.

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2022-11-29 08:57:27 +01:00

799 B

title
ADR: Interface naming

Background

In the codebase, we have found a need to have a common way of naming interfaces in order to ensure consistency.

Decision

We have decided to use a naming convention of appending the letter I in front of interfaces to signify that we are in fact using an interface. For props, we use IComponentNameProps.

// Do:
interface IMyInterface {}
interface IMyComponentNameProps {}

// Don't:
interface MyInterface {}
interface MyComponentName {}

The reason for this decision is to remove mental clutter and free up capacity to easily navigate the codebase. Knowing that an interface is prefixed with I allows you to quickly scan a file without watching for a context where the interface is used in order to understand what it is.