False positive on Typescript - No magic number

  • SonarQube 8.2, SonarTS 2.1

Defining an enum and giving values to their values says that any value bigger than 1 its a magic number.
export enum LOG_TYPE {
DEBUG = 5,
INFO = 4,
WARN = 3,
ERROR = 2,
FATAL = 1,
}

2 Likes

Hey there.

Thanks for the feedback. This is identified in SonarSource/SonarJS #1966 (yes, you read correctly! Typescript support is now provided through the Javascript analyzer). This should be addressed in a future release.

Oh ok, thanks for the fast reply

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.