Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

S109: Magic number -1 #896

Open
nicolasbreuni opened this issue Jan 7, 2020 · 0 comments
Open

S109: Magic number -1 #896

nicolasbreuni opened this issue Jan 7, 2020 · 0 comments

Comments

@nicolasbreuni
Copy link

I want to report a bug.

SonarTS version: 2.1

Node.js version: 10

TypeScript version: 3.5.3

SonarQube version: 8.0

SonarLint version and used IDE: Intellij IDEA

TSLint version: 5.20.1

Rule key: S109

Reproducer

// minimal reproducer if relevant
private readonly _id: number = -1; // No magic number: -1

Expected behavior

In the rule description -1, 0 and 1 are excluded numbers. Thus this line should not be reported.

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant