jscs-jsdoc
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -9,2 +9,3 @@ var assert = require('assert'); | ||
requireParamTypes: require('./require-param-types'), | ||
requireParamDescription: require('./require-param-description'), | ||
requireHyphenBeforeDescription: require('./require-hyphen-before-description'), | ||
@@ -21,2 +22,4 @@ | ||
requireDescriptionCompleteSentence: require('./require-description-complete-sentence'), | ||
checkRedundantAccess: require('./check-redundant-access'), | ||
@@ -23,0 +26,0 @@ enforceExistence: require('./enforce-existence'), |
@@ -75,2 +75,3 @@ module.exports = validateLeadingUnderscoresAccess; | ||
var accessTag; | ||
var override = false; | ||
node.jsdoc.iterate(function(tag) { | ||
@@ -80,2 +81,4 @@ if (!access && ['private', 'protected', 'public', 'access'].indexOf(tag.id) !== -1) { | ||
accessTag = tag; | ||
} else if (tag.id === 'override') { | ||
override = true; | ||
} | ||
@@ -85,3 +88,5 @@ }); | ||
if (!access || !accessTag) { | ||
err('Missing access tag for ' + (name || 'anonymous function'), (nameLocation || node.loc).start); | ||
if (!override) { | ||
err('Missing access tag for ' + (name || 'anonymous function'), (nameLocation || node.loc).start); | ||
} | ||
} else if ([true, access].indexOf(option) === -1) { | ||
@@ -88,0 +93,0 @@ err('Method access doesn\'t match', accessTag.loc); |
@@ -17,5 +17,6 @@ module.exports = validateParamTag; | ||
// checking existance | ||
if (!tag.type) { | ||
return err('Missing param type', (tag.name ? tag.name.loc : null) || tag.loc); | ||
if (tag.type) { | ||
return; | ||
} | ||
return err('Missing param type', (tag.name ? tag.name.loc : null) || tag.loc); | ||
} |
@@ -5,3 +5,3 @@ { | ||
"description": "JSCS jsdoc plugin", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"main": "lib/index", | ||
@@ -28,3 +28,3 @@ "homepage": "https://github.com/jscs-dev/jscs-jsdoc", | ||
"comment-parser": "0.3.0", | ||
"jsdoctypeparser": "1.1.4" | ||
"jsdoctypeparser": "~1.2.0" | ||
}, | ||
@@ -43,3 +43,4 @@ "devDependencies": { | ||
"test": "npm run lint && mocha", | ||
"browserify": "browserify --standalone JsdocJscsPlugin lib/index.js -o jscs-jsdoc-browser.js" | ||
"browserify": "browserify --standalone JsdocJscsPlugin lib/index.js -o jscs-jsdoc-browser.js", | ||
"changelog": "changelog-maker jscs-dev jscs-jsdoc --group" | ||
}, | ||
@@ -46,0 +47,0 @@ "files": [ |
124
README.md
@@ -720,2 +720,126 @@ # jscs-jsdoc | ||
### requireDescriptionCompleteSentence | ||
Ensures a doc comment description is a complete sentence. | ||
A complete sentence is defined as starting with an upper case letter and ending with a period. | ||
Type: `Boolean` | ||
Values: `true` | ||
Context: `functions` | ||
Tags: `*` | ||
#### Example | ||
```js | ||
"requireDescriptionCompleteSentence": true | ||
``` | ||
##### Valid | ||
```js | ||
/** | ||
* @param {String} - message | ||
*/ | ||
function method() {} | ||
/** | ||
* Description. | ||
*/ | ||
function method() {} | ||
/** | ||
* Description. | ||
* | ||
* @param {String} - message | ||
*/ | ||
function method() {} | ||
/** | ||
* Description | ||
* On multiple lines. | ||
* | ||
* @param {String} - message | ||
*/ | ||
function method() {} | ||
``` | ||
##### Invalid | ||
```js | ||
/** | ||
* Description | ||
* @param {String} message | ||
*/ | ||
function method() {} | ||
/** | ||
* description starting with a lower case letter. | ||
* @param {String} message | ||
*/ | ||
function method() {} | ||
/** | ||
* Description period is offset . | ||
* @param {String} message | ||
*/ | ||
function method() {} | ||
/** | ||
* Description! | ||
* @param {String} message | ||
*/ | ||
function method() {} | ||
``` | ||
### requireParamDescription | ||
Ensures a param description exists. | ||
Type: `Boolean` | ||
Values: `true` | ||
Context: `functions` | ||
Tags: `param`, `arg`, `argument` | ||
#### Example | ||
```js | ||
"requireParamDescription": true | ||
``` | ||
##### Valid | ||
```js | ||
/** | ||
* @param {String} arg message | ||
*/ | ||
function method(arg) {} | ||
/** | ||
* @param arg message | ||
*/ | ||
function method(arg) {} | ||
##### Invalid | ||
```js | ||
/** | ||
* @param {String} arg | ||
*/ | ||
function method(arg) {} | ||
/** | ||
* @param arg | ||
*/ | ||
function method(arg) {} | ||
``` | ||
## Browser Usage | ||
@@ -722,0 +846,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99200
29
1835
865
+ Addedjsdoctypeparser@1.2.0(transitive)
+ Addedlodash@3.10.1(transitive)
- Removedjsdoctypeparser@1.1.4(transitive)
Updatedjsdoctypeparser@~1.2.0