Socket
Socket
Sign inDemoInstall

jscs

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscs - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

3

CHANGELOG.md

@@ -0,1 +1,4 @@

Version 1.0.12:
* Fixes for jsdoc params.
Version 1.0.11:

@@ -2,0 +5,0 @@ * Prefix unary rules: `disallowSpaceAfterPrefixUnaryOperators`, `requireSpaceAfterPrefixUnaryOperators`.

2

lib/rules/validate-jsdoc.js

@@ -31,3 +31,3 @@ var assert = require('assert');

if (line.indexOf('@param') === 0) {
var match = line.match(/^@param\s+(?:{([^}]+)})?\s*(?:\[)?([a-zA-Z0-9_\.\$]+)/);
var match = line.match(/^@param\s+(?:{(.+?)})?\s*(?:\[)?([a-zA-Z0-9_\.\$]+)/);
if (match) {

@@ -34,0 +34,0 @@ var jsDocParamType = match[1];

@@ -5,3 +5,3 @@ {

"name" : "jscs",
"version" : "1.0.11",
"version" : "1.0.12",
"repository" : "https://github.com/mdevils/node-jscs",

@@ -8,0 +8,0 @@ "contributors" : [

@@ -200,3 +200,31 @@ var Checker = require('../lib/checker');

});
it('should not report valid jsdoc with object type for method', function() {
checker.configure({ validateJSDoc: { requireParamTypes: true } });
assert(
checker.checkString(
'var x = 1;\n' +
'/**\n' +
' * @param {{foo: string}} xxx\n' +
' */\n' +
'function funcName(xxx) {\n' +
'\n' +
'}'
).isEmpty()
);
});
it('should not report valid jsdoc with object type for function', function() {
checker.configure({ validateJSDoc: { requireParamTypes: true } });
assert(
checker.checkString(
'Cls.prototype = {\n' +
' /**\n' +
' * @param {{foo: string}} xxx\n' +
' */\n' +
' run: function(xxx) {\n' +
' \n' +
' }\n' +
'};'
).isEmpty()
);
});
});

Sorry, the diff of this file is too big to display

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