• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#  Use unique names for types and namespaces.
2
3Rule ``arkts-unique-names``
4
5**Severity: error**
6
7Names for all types (classes, interfaces, enums) and namespaces must be unique
8and distinct from other names, e.g., variable names and function names.
9
10
11## TypeScript
12
13
14```
15
16    let X: string
17    type X = number[] // Type alias with the same name as the variable
18
19```
20
21## ArkTS
22
23
24```
25
26    let X: string
27    type T = number[] // X is not allowed here to avoid name collisions
28
29```
30
31
32