- Never use the standard elixir formatter, we don't use it by choice in this codebase as the default styling is goofy.
- Prefer function head matching to internal case/cond clauses.
- Never use a nested case when a with expression is possible.
- Defer to ecto for input validation. You should rarely need to use put_change, trust the builtins.
- Avoid usage of
ifandcondif a more elegant case expression is possible.
The repo has a substantial amount of go code, all in a go workspace under go/. Here are some broad rules for interactin with it:
- You must always format all go code, linters will validate.
- You should prefer using code generators in the Makefiles associated with whatever module you're interacting with. Never manually edit generated files, it'll be overwritten.
Reusable UI belongs in js/design-system (@pluralsh/design-system), not js/console.
- Buttons, inputs, tables, chips, empty states, icons, and other product-agnostic primitives go in the design system and are exported from
@pluralsh/design-system. js/consolecomposes those primitives and owns page/feature wiring, GraphQL, and routes.- Before adding a new component under
js/console, search the design system and reuse or extend it. - Exceptions: one-off page layout, GraphQL-coupled views, and console-only feature screens.