> For the complete documentation index, see [llms.txt](https://flignats.gitbook.io/full-stack-typescript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flignats.gitbook.io/full-stack-typescript/styleguide/naming-conventions.md).

# Naming conventions

* [General naming guidelines](#general-naming-guidelines)
* [Separate file names with dots and dashes](#separate-file-names-with-dots-and-dashes)
* [Symbols and file names](#symbols-and-file-names)
* [Analytics naming guidelines](#analytics-naming-guidelines)

## General naming guidelines

**Do** use consistent names for all symbols.

**Do** follow a pattern that describes the symbol's feature then its type. The recommended pattern is `feature.type.ts`

## Separate file names with dots and dashes

**Do** use dashes to separate words in the descriptive name.

**Do** use dots to separate the descriptive name from the type.

**Do** use consistent type names for all components following a pattern that describes the component's feature then its type. A recommended pattern is `feature.type.ts`.

**Do** use conventional type names including&#x20;

* `.actions`
* `.component`
* `.constant`
* `.directive`
* `.effects`
* `.facade`
* `.guard`
* `.interface`
* `.module`
* `.pipe`
* `.reducer`
* `.resolver`
* `.routes`
* `.selectors`
* `.service`

Invent additional type names if you must but take care not to create too many.

## Symbols and file names

**Do** use consistent names for all assets named after what they represent.

**Do** use upper camel case for class names.

**Do** match the name of the symbol to the name of the file.

**Do** append the symbol name with the conventional suffix (such as `Component`, `Directive`, `Module`, `Pipe`, or `Service`) for a thing of that type.

**Do** give the filename the conventional suffix (such as `.component.ts`, `.directive.ts`, `.module.ts`, `.pipe.ts`, or `.service.ts`) for a file of that type.

## Analytics naming guidelines

**Do** use `lowercase`  for names and properties

**Do** use `underscores` to separate words

**Do** start with a letter.&#x20;

**Do** use only letters, numbers, and underscores.

**Do** follow Google's naming rules

Reference: [Google's event naming rules](https://support.google.com/analytics/answer/13316687?hl=en\&ref_topic=13367860#zippy=%2Cmobile-android-and-ios%2Cweb)

<mark style="color:red;">**Avoid**</mark> spaces

<mark style="color:red;">**Avoid**</mark> reserved event names

<mark style="color:red;">**Avoid**</mark> reserved prefixes
