- 필수 기능
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- 디지털 경험
- 소프트웨어 제공
- 보안
- 로그 관리
- 관리
- 인프라스트럭처
- ci
- containers
- csm
- ndm
- otel_guides
- overview
- slos
- synthetics
- tests
- 워크플로
ID: typescript-best-practices/no-duplicate-enum-values
Language: TypeScript
Severity: Warning
Category: Error Prone
An enum
should not have duplicate values, which are usually not expected to be present.
enum A {
A = 1,
B = 1,
}
enum B {
A = 'A',
B = 'A',
}
enum C {
A = 'A',
B = 'A',
C = 1,
D = 1,
}
enum E {
A = 'A',
B = 'A',
C = 1,
D = 1,
}
enum A {
A,
B,
}
enum B {
A = 1,
B,
}
enum C {
A = 1,
B = 2,
}
enum D {
A = 'A',
B = 'B',
}
enum E {
A = 'A',
B = 'B',
C,
}
enum F {
A = 'A',
B = 'B',
C = 2,
D = 1 + 1,
}
enum G {
A = 3,
B = 2,
C,
}
enum H {
A = 'A',
B = 'B',
C = 2,
D = foo(),
}
enum I {
A = '',
B = 0,
}
enum J {
A = 0,
B = -0,
C = NaN,
}
|
|
For more information, please read the Code Analysis documentation
Identify code vulnerabilities directly in yourVS Code editor
Identify code vulnerabilities directly inJetBrains products