angelozerr / tern-lint

Tern plugin to validate JavaScripts files to collect semantic errors
http://ternjs.net/
MIT License
62 stars 13 forks source link

New Validation: Assignment of wrong type, according to JSDoc #31

Closed p-bakker closed 9 years ago

p-bakker commented 9 years ago

Produce a builder marker when a variable gets assigned a value of a type that is not the same as the type defined in the JSDoc

p-bakker commented 9 years ago

Sample:

/**
 * @type {Boolean}
 */
var test

test = 'hello' //Raise warning
angelozerr commented 9 years ago

To support this issue, I need the following PR https://github.com/marijnh/tern/pull/525 to know tha type comes from comment.

angelozerr commented 9 years ago

See https://github.com/angelozerr/tern-lint/wiki/Validation-JSDoc for configuration of JSDoc