Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive: let with flow annotation not counted as declaration #828

Closed
NilSet opened this issue Nov 8, 2017 · 0 comments
Closed

False positive: let with flow annotation not counted as declaration #828

NilSet opened this issue Nov 8, 2017 · 0 comments
Labels
type: false positive Issue is reported when it should NOT be
Milestone

Comments

@NilSet
Copy link
Contributor

NilSet commented Nov 8, 2017

I want to report a bug.
let variable declarations annotated with a flow type are seemingly not tracked as a declaration.

SonarJS version: 3.2

Rule key: S2703 aka VariableDeclarationWithoutVarCheck

Reproducer

let unflowed;
unflowed = true; // ok

let flowed: boolean;
flowed = true; //false positive

Expected behavior
Recognize the annotated let statement as the declaration of flowed instead of assuming the usage of flowed is an implicit global declaration.

@vilchik-elena vilchik-elena added this to the 3.4 milestone Nov 9, 2017
@vilchik-elena vilchik-elena added the type: false positive Issue is reported when it should NOT be label Nov 9, 2017
NilSet pushed a commit to NilSet/sonar-javascript that referenced this issue Nov 9, 2017
Fixes SonarSource#828 and also some other false negatives from ReassignedParameter
vilchik-elena added a commit that referenced this issue Nov 20, 2017
vilchik-elena added a commit that referenced this issue Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: false positive Issue is reported when it should NOT be
Projects
None yet
Development

No branches or pull requests

2 participants