Ditsmod coding style guide
Here is the recommended format in the form of a pair "file name" - "class name":
hello-world.module.ts-HelloWorldModule;hello-world.controller.ts-HelloWorldController;hello-world.service.ts-HelloWorldService;auth.guard.ts-AuthGuard.
That is,
- the names of any files must contain only lowercase letters;
- if there are several words in the file name, you should separate them with a hyphen;
- class roles must precede the extension and must be preceded by a dot (
*.module.ts,*.controller.ts,*.service.ts,*.guard.ts); - class names must start with a capital letter, and contain exactly the same words as in the name of their files, but in the style of CamelCase.
- End-to-end tests should be kept in a separate directory named
e2e, at the same level as thesrcroot directory.
It is recommended to call the root module - AppModule.
When importing, it is recommended not to mix import from local files and import from node_modules. At the top are imports from node_modules, and then retreating one line are local imports:
import { injectable, Status } from '@ditsmod/core';
import { CanActivate } from '@ditsmod/rest';
import { AuthService } from './auth.service.js';
import { Permission } from './permission.js';
Extension group token names must end in _EXTENSIONS, such as MY_EXTENSIONS.