Skip to content

Salsa does not warn or help when passing in wrong argument type #2442

Closed

Description

Testing #2218

/**
 * @param {string} name
 */
function howdy(name) {

}

howdy(3);

image

even if it knows a string is expected:

image

Activity

  1. billti commented on Jan 27, 2016

    @billti
    Member

    Correct. We explicitly decided to give no warnings/errors other than syntax errors for JavaScript code. If warnings on incorrect type usage are required, we'd need to spec how and when these would occur in JavaScript, else being based on TypeScript, code such as the below would also be a type error:

    var x = 10;
    x = "ten";
    
    var y = {a:true};
    y.b = false;
    
  2. egamma commented on Jan 27, 2016

    @egamma
    Member

    In the existing Code JS language service we gave warnings for the first example above and we didn't receive complaints.

    errors

    We have also warned about undefined variables, which had issues when users where also using a linter in their project and they defined a global as a global in their linter configuration. The confusion was that they define the global in linter configuration, but our JS service still warned about the global.

  3. egamma commented on Jan 27, 2016

    @egamma
    Member

    This issue was moved to microsoft/TypeScript#6658

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions