Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jscs-jsdoc

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscs-jsdoc - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

CHANGELOG.md

3

lib/rules/validate-jsdoc/index.js

@@ -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);

5

lib/rules/validate-jsdoc/require-param-types.js

@@ -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": [

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc