jscs-dev / jscs-jsdoc

JsDoc validation rules for jscs
MIT License
99 stars 35 forks source link

Support module: and external: in checkTypes #88

Closed pelepelin closed 9 years ago

pelepelin commented 9 years ago

When jscs with checkTypes enabled meets the line like

* @param {module:my-name.SomeName} bla

it reports an error "expects valid type instead of module:my-name.SomeName". It should accept module:module-name and external:module-name prefixes.

http://usejsdoc.org/howto-commonjs-modules.html#module-identifiers shows examples of namepaths like module:my/pants.Jeans#hem and http://usejsdoc.org/tags-external.html shows the same for externals like external:String#rot13

Tested: jscs@1.12.0 jscs-jsdoc@0.4.5

qfox commented 9 years ago

Thanks for noticing. We using here jsdoctypeparser which already has https://github.com/Kuniwak/jsdoctypeparser/issues/6

Can you ask @Kuniwak about it?

/**
 * @param {module: famouse/core/Context}
 */

And about external: Are you sure that external:* is available for types?

pelepelin commented 9 years ago

It seems jsdoctypeparser supports 'module:'

var Parser = require('jsdoctypeparser').Parser;
var parser = new Parser();
parser.parse('module:my/pants.Jeans#hem')
{ types: [ { name: 'my/pants.Jeans#hem' } ],
  count_: 1 }

Is it something unexpected?

I'll ask for external, though.

JSDoc examples show the same syntax for "external" and "module" and properly generates references when used as @param {external:...}.

qfox commented 9 years ago

Thanks again. Seems like problem with minus sign. Need to fix it definitely.

pelepelin commented 9 years ago

Kuniwak/jsdoctypeparser/issues/12