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

Config noImplicitAny seems to be not working since typescript 2.1 #18679

Closed
Flarna opened this issue Sep 22, 2017 · 2 comments
Closed

Config noImplicitAny seems to be not working since typescript 2.1 #18679

Flarna opened this issue Sep 22, 2017 · 2 comments
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@Flarna
Copy link

Flarna commented Sep 22, 2017

TypeScript Version: 2.5.2 / nightly (2.6.0-dev.20170922)

Code
tsconfig.json with noImplicitAny set to true:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "strict": true,
    "noImplicitAny": true
  }
}

Creating a variable without specifying a type:

let i;
i = 5;
i = "foo";

Expected behavior:
Typescript compiler complains that i is implicit any.

Actual behavior:
Typescript compile does not report any issue.

If I use typescript 2.0.10 (with adapted tsconfig.json) I get "error TS7005: Variable 'i' implicitly has an 'any' type." as expected.

@Flarna Flarna changed the title Config noImplicitAny seems to be not working Config noImplicitAny seems to be not working since typescript 2.1 Sep 22, 2017
@HerringtonDarkholme
Copy link
Contributor

Actually it is a new feature.

#11263

@DanielRosenwasser DanielRosenwasser added the Working as Intended The behavior described is the intended behavior; this is not a bug label Sep 22, 2017
@Flarna
Copy link
Author

Flarna commented Sep 22, 2017

Ah ok thanks, thats fine.
Seems I got confused by VsCode which shows let i: any if I hover my mouse pointer over the statement i = 5.

@Flarna Flarna closed this as completed Sep 22, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

3 participants