Skip to content

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

Closed
@Flarna

Description

@Flarna

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.

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