Skip to content

Commit

Permalink
Upgrade: doctrine version to 1.1.0 (fixes #4854)
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaub committed Jan 7, 2016
1 parent 2ccbc01 commit 7c97201
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -38,7 +38,7 @@
"chalk": "^1.0.0",
"concat-stream": "^1.4.6",
"debug": "^2.1.1",
"doctrine": "^0.7.1",
"doctrine": "^1.1.0",
"es6-map": "^0.1.3",
"escape-string-regexp": "^1.0.2",
"escope": "^3.3.0",
Expand Down
46 changes: 46 additions & 0 deletions tests/lib/rules/valid-jsdoc.js
Expand Up @@ -203,6 +203,26 @@ ruleTester.run("valid-jsdoc", rule, {
parserOptions: {
ecmaVersion: 6
}
},


{
code:
"/**\n" +
" * Use of this with a 'namepath'.\n" +
" * @this some.name\n" +
" */\n" +
"function foo() {}",
options: [{requireReturn: false}]
},
{
code:
"/**\n" +
" * Use of this with a type expression.\n" +
" * @this {some.name}\n" +
" */\n" +
"function foo() {}",
options: [{requireReturn: false}]
}
],

Expand Down Expand Up @@ -561,6 +581,32 @@ ruleTester.run("valid-jsdoc", rule, {
parserOptions: {
ecmaVersion: 6
}
},
{
code:
"/**\n" +
" * Use of this with an invalid type expression\n" +
" * @this {not.a.valid.type.expression\n" +
" */\n" +
"function foo() {}",
options: [{requireReturn: false}],
errors: [{
message: "JSDoc type missing brace.",
type: "Block"
}]
},
{
code:
"/**\n" +
" * Use of this with a type that is not a member expression\n" +
" * @this {Array<string>}\n" +
" */\n" +
"function foo() {}",
options: [{requireReturn: false}],
errors: [{
message: "JSDoc syntax error.",
type: "Block"
}]
}
]
});

0 comments on commit 7c97201

Please sign in to comment.