Skip to content

Code Style

Strayker edited this page Oct 29, 2023 · 1 revision

Code Style

Web Frontend

  • When creating new component, we don't use prefixes, only raw component's name,
  • When opening brackets block, the first bracket stays on the same line as is the head of code block,
  • We place components in file structure and module based on their usage scope, if component is designated to be used only in one place, leave it in given page folder and module, if this component will be used in multiple places, move it to "shared" folder and module appropriately,
  • Follow official Google TypeScript Style Guide,
  • Separate logical blocks of code with empty lines,

Web Backend

  • "var"s are allowed, but only when defined variable's type is clearly readable directly from the code, any other case requires use of type name,
  • Follow official Microsoft C# Coding Conventions,
  • Separate logical blocks of code with empty lines,

Automation Tools

In this project there are some tools to help you out with styling the code:

  • Web Frontend has Prettier comfigured, use npm run prettier in CLI to run tool manually, or create new commit and Prettier will auto run by Husky hook activation,
  • Web Backend can be formatted with CodeMaid VS extension,

Clone this wiki locally