Skip to content

// @ts-check no longer seems to work for js files in implicit project #19588

Closed
@mjbvz

Description

@mjbvz

TypeScript Version: 2.6.1-insiders.20171019

Steps to Reproduce

  1. Open an empty folder in VS Code

  2. Open a blank js file.

    // @ts-check
    let b = 123;
    b = ''

Expected behavior:
With VS Code and TS 2.5.2 this is reported as an error.

[Trace  - 2:55:51 PM] Sending request: geterr (6). Response expected: no. Current queue length: 0
Arguments: {
    "delay": 0,
    "files": [
        "/Users/matb/projects/san/src/bar.js"
    ]
}
[Trace  - 2:55:51 PM] Event received: syntaxDiag (0).
Data: {
    "file": "/Users/matb/projects/san/src/bar.js",
    "diagnostics": []
}
[Trace  - 2:55:51 PM] Event received: semanticDiag (0).
Data: {
    "file": "/Users/matb/projects/san/src/bar.js",
    "diagnostics": [
        {
            "start": {
                "line": 3,
                "offset": 1
            },
            "end": {
                "line": 3,
                "offset": 2
            },
            "text": "Type '\"\"' is not assignable to type 'number'.",
            "code": 2322,
            "category": "error"
        }
    ]
}

Actual behavior:
No error with 2.6

[Trace  - 2:53:16 PM] Sending request: geterr (7). Response expected: no. Current queue length: 0
Arguments: {
    "delay": 0,
    "files": [
        "/Users/matb/projects/san/src/bar.js",
        "untitled:Untitled-1"
    ]
}
[Trace  - 2:53:16 PM] Event received: syntaxDiag (0).
Data: {
    "file": "/Users/matb/projects/san/src/bar.js",
    "diagnostics": []
}

We never receive the semanticDiag message in this case

// cc @mhegazy and @chrmarti

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueHigh PriorityVS Code TrackedThere is a VS Code equivalent to this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions