Skip to content

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

Closed

Description

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.

Activity

  1. changed the title [-]Config noImplicitAny seems to be not working[/-] [+]Config noImplicitAny seems to be not working since typescript 2.1[/+] on Sep 22, 2017
  2. HerringtonDarkholme commented on Sep 22, 2017

    @HerringtonDarkholme
    Contributor

    Actually it is a new feature.

    #11263

  3. Flarna commented on Sep 22, 2017

    @Flarna
    Author

    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.

  4. locked and limited conversation to collaborators on Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions