Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation JSDoc does not work #46

Closed
paulvi opened this issue Jul 13, 2015 · 15 comments
Closed

Validation JSDoc does not work #46

paulvi opened this issue Jul 13, 2015 · 15 comments

Comments

@paulvi
Copy link

paulvi commented Jul 13, 2015

I tried https://github.com/angelozerr/tern-lint/wiki/Validation-JSDoc

/**
 * @param {number} millis
 * @param {function} callback
 * */
function sleep(millis, callback) {
    setTimeout(function() {
        callback();
    }, millis);
}



sleep('a','b');

sleep('a','b');

using .tern-project as

{"libs":["ecma5"],"plugins":{
    "doc_comment":{"strong": true},
    "lint": {}
    "node":{}},"ide":{}
}

and then again going to project properties Tern -> Validation -> Lint
and with result like this:

{   "ide":{},
    "doc_comment":{"strong":true},
    "lint":{},
    "plugins":{
        "lint":{
            "config":{}
        },
        "node":{}
    },
    "libs":["ecma5"]
}

How to make it work?

I tried with 0.10 and
1.0.0.201507101609

@angelozerr
Copy link
Owner

What do you mean with doesnt work

@paulvi
Copy link
Author

paulvi commented Jul 15, 2015

It was not showing error for sleep('a','b')

And while initially it was related to tern.java version, I could not get consistent result, see angelozerr/tern.java#300

@angelozerr
Copy link
Owner

For callback error you canuse Function instead ofusing function for @param to remove this error

@paulvi
Copy link
Author

paulvi commented Jul 16, 2015

How to use Function ?

@angelozerr
Copy link
Owner

Today you musr write Function in the param instead of function

I had created a basic PR to support function

See ternjs/tern#561
See

@angelozerr
Copy link
Owner

It was not showing error for sleep('a','b')

Please try with last version of 1.0.0-SNAPSHOT. It works for me?

@paulvi
Copy link
Author

paulvi commented Aug 12, 2015

Testing with the current SNAPSHOT

{"ide":{},"doc_comment":{"strong":true},"lint":{},
"plugins":{
    "doc_comment":{"strong":true},
    "lint":{"config":{}},
    "node":{}
},"libs":["ecma5"]}

The first time I change .tern-project there is Yes-No Dialog, but later there is no,
e.g. when I add empty line.

1

[Lint]: 'callback' is not a function

and new weird
2

[Lint]: Invalid argument at 1: cannot convert from String.prototype to Buffer.prototype

@paulvi
Copy link
Author

paulvi commented Aug 12, 2015

After changing function to Function

3

There is correct error for sleep('a','b');
but for callback(); again

[Lint]: 'callback' is not a function

@angelozerr
Copy link
Owner

The first time I change .tern-project there is Yes-No Dialog, but later there is no,
e.g. when I add empty line.

What is the problem with that, it's the same behaviour than other WTP Validator (HTML, XML, etc)

and new weird

You mean that res.end('') must not raise error?

There is correct error for sleep('a','b'); but for callback(); again

Yes I know See ternjs/tern#561

@angelozerr
Copy link
Owner

@paulvi if you have problem with validation like res.end('') , please create an issues at https://github.com/angelozerr/tern-lint/issues

It should be very cool if you could play with lint + node and creates a lto of issues to improve it.

Can we close this issue?

@angelozerr
Copy link
Owner

@paulvi for you rproblem with res.end('') , I have created a PR for tern https://github.com/marijnh/tern/pull/602/files#diff-44a33130248596d4bb0ec800a79bd660R454

@angelozerr
Copy link
Owner

@paulvi can we close this issue?

@paulvi
Copy link
Author

paulvi commented Aug 15, 2015

well, technically we should close this when those 2 referenced issues are closed. It is up to you.

@angelozerr
Copy link
Owner

Ok, but for Function I'm afraid that tern will not support it. I don't know?

@paulvi
Copy link
Author

paulvi commented Aug 18, 2015

closing as becoming to long.

@paulvi paulvi closed this as completed Aug 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants