mirror of
https://github.com/labs42io/clean-code-typescript.git
synced 2025-04-18 15:13:34 +00:00
Add mention of import type
to import section
This commit is contained in:
parent
dcdccaaecc
commit
3c0634c0ea
1 changed files with 3 additions and 0 deletions
|
@ -2683,6 +2683,7 @@ With clean and easy to read import statements you can quickly see the dependenci
|
|||
- Unused imports should be removed.
|
||||
- Named imports must be alphabetized (i.e. `import {A, B, C} from 'foo';`)
|
||||
- Import sources must be alphabetized within groups, i.e.: `import * as foo from 'a'; import * as bar from 'b';`
|
||||
- Prefer using `import type` instead of `import` when importing only types from a file to avoid dependency cycles, as these imports are erased at runtime
|
||||
- Groups of imports are delineated by blank lines.
|
||||
- Groups must respect following order:
|
||||
- Polyfills (i.e. `import 'reflect-metadata';`)
|
||||
|
@ -2697,6 +2698,7 @@ With clean and easy to read import statements you can quickly see the dependenci
|
|||
```ts
|
||||
import { TypeDefinition } from '../types/typeDefinition';
|
||||
import { AttributeTypes } from '../model/attribute';
|
||||
import { Customer, Credentials } from '../model/types';
|
||||
import { ApiCredentials, Adapters } from './common/api/authorization';
|
||||
import fs from 'fs';
|
||||
import { ConfigPlugin } from './plugins/config/configPlugin';
|
||||
|
@ -2714,6 +2716,7 @@ import { BindingScopeEnum, Container } from 'inversify';
|
|||
|
||||
import { AttributeTypes } from '../model/attribute';
|
||||
import { TypeDefinition } from '../types/typeDefinition';
|
||||
import type { Customer, Credentials } from '../model/types';
|
||||
|
||||
import { ApiCredentials, Adapters } from './common/api/authorization';
|
||||
import { ConfigPlugin } from './plugins/config/configPlugin';
|
||||
|
|
Loading…
Add table
Reference in a new issue