Repository: eslint/doctrine (js)

Issue:
validation is failing at hyphen in @alias module:module-name
Examples:

- fails
```
/**
 * Module desc
 *
 * @module module-name
 */

/**
 * Constructor desc
 *
 * @constructor
 * @alias module:module-name
 */
```

- works
```
/**
 * Module desc
 *
 * @module module
 */

/**
 * Constructor desc
 *
 * @constructor
 * @alias module:module
 */
```

- works
```
/**
 * Module desc
 *
 * @module module_name
 */

/**
 * Constructor desc
 *
 * @constructor
 * @alias module:module_name
 */
```

- works
```
/**
 * Module desc
 *
 * @module module-name
 */

/**
 * Constructor desc
 *
 * @constructor
 */
```

Original issue: https://github.com/eslint/eslint/issues/3319

Thank you.


Pull request:
Fix: allow hyphens in names (fixes #116)
Whoops, I use `hub` on the command line and totally forgot to set my remote upstream before making the initial PR. Sorry for the confusion :grimacing: 

I'm still learning about JSDoc so apologies if I missed something (this felt a little too easy), but thought I'd take a crack at this. Fun to look through the doctrine code and start getting a sense of what's going on under the hood!

Wrote a few tests in ESLint and tested while npm linking this branch - all tests passed. Can make a PR with those tests if we decide to merge this.

Patch:
diff --git a/.github/issue_template.md b/.github/issue_template.md
deleted file mode 100644
index e74389f..0000000
--- a/.github/issue_template.md
+++ /dev/null
@@ -1,14 +0,0 @@
-**What version are you using?**
-
-
-**What JSDoc comment were you trying to parse?**
-
-
-**What Doctrine options were you using (sloppy, unwrap, etc.)?**
-
-
-**What happened? Include output if possible.**
-
-
-**What did you expect to happen?**
-
diff --git a/lib/doctrine.js b/lib/doctrine.js
index 4fe8ca4..f82331d 100644
--- a/lib/doctrine.js
+++ b/lib/doctrine.js
@@ -334,6 +334,7 @@
                 while (source.charCodeAt(index) === 0x2E  /* '.' */ ||
                         source.charCodeAt(index) === 0x2F  /* '/' */ ||
                         source.charCodeAt(index) === 0x23  /* '#' */ ||
+                        source.charCodeAt(index) === 0x2D  /* '-' */ ||
                         source.charCodeAt(index) === 0x7E  /* '~' */) {
                     name += advance();
                     name += scanIdentifier(last);


Test patch:
diff --git a/test/parse.js b/test/parse.js
index f24a5a0..9a45f8d 100644
--- a/test/parse.js
+++ b/test/parse.js
@@ -58,6 +58,13 @@ describe('parse', function () {
         res.tags[0].should.have.property('name', 'module:mymodule/mymodule.init');
     });
 
+    it('alias with namepath with hyphen in it', function () {
+        var res = doctrine.parse('/** @alias module:mymodule/my-module */', { unwrap: true });
+        res.tags.should.have.length(1);
+        res.tags[0].should.have.property('title', 'alias');
+        res.tags[0].should.have.property('name', 'module:mymodule/my-module');
+    });
+
     it('const', function () {
         var res = doctrine.parse('/** @const */', { unwrap: true });
         res.tags.should.have.length(1);
@@ -332,6 +339,13 @@ describe('parse', function () {
         res.tags[0].should.have.property('name', 'thingName.name');
     });
 
+    it('module with name that has a hyphen in it', function () {
+        var res = doctrine.parse('/** @module thingName-name */', { unwrap: true });
+        res.tags.should.have.length(1);
+        res.tags[0].should.have.property('title', 'module');
+        res.tags[0].should.have.property('name', 'thingName-name');
+    });
+
     it('module with type', function () {
         var res = doctrine.parse('/** @module {Object} thingName.name */', { unwrap: true });
         res.tags.should.have.length(1);