Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
jscs-jsdoc
Advanced tools
jsdoc
plugin for jscs. Twitter | Mailing List
jscs-jsdoc
can be installed using NPM and requires jscs.
Install it globally if you are using globally installed jscs
npm -g install jscs-jsdoc
But better install it into your project
npm install jscs-jsdoc --save-dev
We recommend installing jscs-jsdoc
via NPM using ^
, or ~
if you want more stable releases.
Semver (http://semver.org/) dictates that breaking changes be major version bumps. In the context of a linting tool, a bug fix that causes more errors to be reported can be interpreted as a breaking change. However, that would require major version bumps to occur more often than can be desirable. Therefore, as a compromise, we will only release bug fixes that cause more errors to be reported in minor versions.
Below you fill find our versioning strategy, and what you can expect to come out of a new jscs-jsdoc
release.
jscs-jsdoc
to report less errors;jscs-jsdoc
to report more errors;To use plugin you should add these lines to configuration file .jscsrc
:
{
"additionalRules": [
"node_modules/jscs-jsdoc/lib/rules/*.js"
],
"jsDoc": {
"enforceExistence": true
}
}
Ensures param names in jsdoc and in function declaration are equal
Type: Boolean
Values: true
Context: functions
Tags: param
, arg
, argument
"checkParamNames": true
/**
* @param {String} message
* @param {Number|Object} [line]
*/
function method(message, line) {}
/**
* @param {String} msg
* @param {Number|Object} [line]
*/
function method(message) {}
Ensures params in jsdoc contains type
Type: Boolean
Values: true
Context: functions
Tags: param
, arg
, argument
"requireParamTypes": true
/**
* @param {String} message
*/
function method() {}
/**
* @param message
*/
function method() {}
Reports redundant params in jsdoc
Type: Boolean
Values: true
Context: functions
Tags: param
, arg
, argument
"checkRedundantParams": true
/**
* @param {String} message
*/
function method(message) {}
/**
* @param {String} message
*/
function method() {}
Reports discrepancies between the claimed in jsdoc and actual type if both exist (code scan)
Type: Boolean
Values: true
Context: functions
Tags: return
, returns
"checkReturnTypes": true
/**
* @returns {String}
*/
function method() {
return 'foo';
}
/**
* @returns {String}
*/
function method(f) {
if (f) {
return true;
}
return 1;
}
Report statements for functions with no return
Type: Boolean
Values: true
Context: functions
Tags: return
, returns
"checkRedundantReturns": true
/**
* @returns {string}
*/
function f() {
return 'yes';
}
/**
* @returns {string}
*/
function f() {
// no return here
}
Ensures returns in jsdoc contains type
Type: Boolean
Values: true
Context: functions
Tags: return
, returns
"requireReturnTypes": true
/**
* @returns {String}
*/
function method() {}
/**
* no @return
*/
function method() {}
/**
* @returns
*/
function method() {}
Reports invalid types for bunch of tags
Type: Boolean
Values: true
Context: *
Tags: typedef
, type
, param
, return
, returns
, enum
, var
, prop
, property
, arg
, argument
, cfg
, lends
, extends
, implements
, define
"checkTypes": true
/**
* @typedef {Object} ObjectLike
* @property {boolean} hasFlag
* @property {string} name
*/
/** @type {number} */
var bar = 1;
/** @const {number} */
var FOO = 2;
/**
* @const
* @type {number}
*/
var BAZ = 3;
/**
* @param {SomeX} x
* @returns {string}
*/
function method(x) {}
/** @type {some~number} */
var x = 1;
Reports redundant access declarations
Type: Boolean
Values: true
Context: functions
Tags: access
, private
, protected
, public
"checkRedundantAccess": true
/**
* @access private
*/
function _f() {}
/**
* @private
* @access private
*/
function _f() {}
Ensures access declaration is set for _underscored
function names
Type: Boolean
or String
Values: true
(means not public), "private"
, "protected"
Context: functions
Tags: access
, private
, protected
, public
"checkRedundantAccess": "protected"
/**
* @protected
*/
function _f() {}
function _g() {}
/**
* @private
*/
function _e() {}
Ensures jsdoc block exist
Type: Boolean
Values: true
Context: functions
"enforceExistence": true
/**
* @protected
*/
function _f() {}
function _g() {}
Ensures a param description has a hyphen before it (checks for -
)
Type: Boolean
Values: true
Context: functions
Tags: param
, arg
, argument
"requireHyphenBeforeDescription": true
/**
* @param {String} - message
*/
function method() {}
/**
* @param {String} message
*/
function method() {}
NOT SUPPORTED ATM. SORRY.
File jscs-jsdoc-browser.js contains browser-compatible version of jscs-jsdoc
.
Download and include jscs-jsdoc-browser.js
into your page just after jscs-browser.js
.
<script src="jscs-browser.js"></script>
<script src="jscs-jsdoc-browser.js"></script>
<script>
var checker = new JscsStringChecker();
checker.registerDefaultRules();
checker.configure({'jsDoc': {/* ... */}});
var errors = checker.checkString('var x, y = 1;');
errors.getErrorList().forEach(function (error) {
console.log(errors.explainError(error));
});
</script>
[v0.0.24] - 2014-11-18
b7dd13ef3b
] - new rule: requireHyphenBeforeDescription (Henry Zhu)bf7b174091
] - checkRedundantParams: fixup invalid example in readme (Alexej Yaroshevich)e317b03511
] - rules: change test case wording to be consistent (Henry Zhu)78ceb47cec
] - requireHyphenBeforeDescription: add rule to readme (Henry Zhu)FAQs
JSCS jsdoc plugin
The npm package jscs-jsdoc receives a total of 30,015 weekly downloads. As such, jscs-jsdoc popularity was classified as popular.
We found that jscs-jsdoc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.