Comments (10)
Thanks for contributing.
I think it's a bug in matching logic. Need to add this as a test case and fix.
from jscs-jsdoc.
Almost done. I'll merge branch into master soon.
from jscs-jsdoc.
@zxqfox That last commit did not actually fix my issue. The test does not correspond to what I am actually doing. The test returns a non-existent type called {Class}
whereas I'm returning a @typedef
called {UsersState}
. Can you please reopen this issue?
from jscs-jsdoc.
@cowwoc Did you upgraded to v0.0.20?
from jscs-jsdoc.
@cowwoc @typedef
shouldn't care about another tags. Btw now rule checkTypes
forces testing existent types for bunch of tags (@typedef
, @property
, etc.).
Also I've added a test case for this issue and it works fine. ;-\
from jscs-jsdoc.
@zxqfox Yes, I updated to 0.0.20 and I am still seeing this problem. I will try to provide you with more information in a minute.
from jscs-jsdoc.
@typedef shouldn't care about another tags.
What does this mean?
Okay, now here is how I am able to reproduce this issue:
Create Aaa.js with the following contents:
/* global define:false */
define(function()
{
"use strict";
var Test = {};
/**
* @typedef {Object} AuthenticationsState
*
* @property {String} id the DOM id of the component that generated the state
* @property {Object} state the page's state
*/
/**
* @return {AuthenticationsState} the page's state
*/
Test.prototype.getState = function()
{
return {
id: "main",
state:
{
loginForm: this.loginForm.getState(),
signupForm: this.signupForm.getState()
}
};
};
return Test;
});
Here is my package.json file:
{
"name": "myproject",
"private": true,
"dependencies":
{
"grunt": "~0.4.5",
"grunt-cli": "~0.1.13",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-csslint": "~0.3.1",
"grunt-jscs": "~0.8.1",
"jscs": "~1.7.3",
"jscs-jsdoc": "~0.0.20",
"csslint": "~0.10.0",
"jshint": "~2.5.6"
}
}
Here is my Gruntfile.js:
module.exports = function(grunt)
{
grunt.initConfig(
{
pkg: grunt.file.readJSON("package.json"),
csslint:
{
src: "../../../target/classes/css/**/*.css",
options:
{
absoluteFilePathsForFormatters: true,
important: 2,
"adjoining-classes": false,
"known-properties": 2,
"box-sizing": false,
// WORKAROUND: https://github.com/CSSLint/csslint/issues/544
"box-model": false,
"overqualified-elements": true,
"display-property-grouping": 2,
"bulletproof-font-face": false,
"compatible-vendor-prefixes": true,
"regex-selectors": false,
"errors": 2,
"duplicate-background-images": true,
"duplicate-properties": 2,
"empty-rules": true,
"selector-max-approaching": true,
gradients: true,
"fallback-colors": false,
"font-sizes": true,
"font-faces": 2,
"floats": true,
"star-property-hack": 2,
"outline-none": true,
"import": false,
"ids": false,
"underscore-property-hack": 2,
"rules-count": 2,
"qualified-headings": 2,
"selector-max": 2,
shorthand: false,
"text-indent": 2,
"unique-headings": 2,
"universal-selector": true,
"unqualified-attributes": true,
"vendor-prefix": 2,
"zero-units": 2
}
},
jshint:
{
all: ["../../../target/classes/js/**/*.js"],
options:
{
bitwise: true,
eqeqeq: true,
forin: true,
freeze: true,
latedef: true,
noarg: true,
nonbsp: true,
nonew: true,
undef: true,
unused: "vars",
strict: true,
maxdepth: 4,
browser: true,
jquery: true,
devel: true
}
},
jscs:
{
src: "../../../target/classes/js/**/*.js",
options:
{
requireCurlyBraces: ["try", "catch"],
requireSpaceAfterKeywords: ["if", "for", "while", "do", "switch", "return", "catch"],
requireSpacesInConditionalExpression: true,
requireSpaceBeforeBlockStatements: true,
requireSpacesInFunctionExpression:
{
beforeOpeningCurlyBrace: true
},
disallowSpacesInFunctionExpression:
{
beforeOpeningRoundBrace: true
},
requireSpacesInFunctionDeclaration:
{
beforeOpeningCurlyBrace: true
},
disallowSpacesInFunctionDeclaration:
{
beforeOpeningRoundBrace: true
},
// WORKAROUND: https://netbeans.org/bugzilla/show_bug.cgi?id=248443
// disallowSpacesInCallExpression: true,
requireBlocksOnNewline: true,
disallowPaddingNewlinesInBlocks: true,
requirePaddingNewLinesInObjects: true,
disallowEmptyBlocks: true,
disallowQuotedKeysInObjects: true,
disallowDanglingUnderscores: true,
requireCommaBeforeLineBreak: true,
requireOperatorBeforeLineBreak: ["?", "+", "-", "/", "*", "=", "==", "===", "!=",
"!==", ">", ">=", "<", "<="],
disallowSpaceAfterPrefixUnaryOperators: ["++", "--", "+", "-", "~", "!"],
disallowSpaceBeforePostfixUnaryOperators: ["++", "--"],
disallowSpaceBeforeBinaryOperators: [","],
requireSpaceBeforeBinaryOperators: ["+", "-", "/", "*", "=", "==", "===", "!=", "!==",
">", ">=", "<", "<="],
requireSpaceAfterBinaryOperators: ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
requireCamelCaseOrUpperCaseIdentifiers: true,
disallowMultipleLineStrings: true,
disallowMultipleLineBreaks: true,
validateQuoteMarks:
{
"mark": "\"", "escape": true
},
// WORKAROUND: https://netbeans.org/bugzilla/show_bug.cgi?id=227007
//validateIndentation: "\t",
disallowMixedSpacesAndTabs: "smart",
disallowTrailingWhitespace: true,
disallowTrailingComma: true,
requireKeywordsOnNewLine: ["else"],
maximumLineLength:
{
value: 120,
tabSize: 2,
allowUrlComments: true
},
requireCapitalizedConstructors: true,
disallowYodaConditions: true,
validateParameterSeparator: ", ",
requireNewlineBeforeBlockStatements: true,
maxErrors: 10,
additionalRules:
[
"node_modules/jscs-jsdoc/lib/rules/*.js"
],
jsDoc:
{
// WORKAROUND: https://github.com/jscs-dev/jscs-jsdoc/issues/33
// checkParamNames: true,
requireParamTypes: true,
checkRedundantParams: true,
// WORKAROUND: https://github.com/jscs-dev/jscs-jsdoc/issues/32
// WORKAROUND: https://github.com/jscs-dev/jscs-jsdoc/issues/34
checkReturnTypes: true,
// WORKAROUND: https://github.com/jscs-dev/jscs-jsdoc/issues/35
// checkTypes: true,
// WORKAROUND: https://github.com/jscs-dev/jscs-jsdoc/issues/31
// checkRedundantReturns: true,
checkRedundantAccess: true,
leadingUnderscoreAccess: "private"
// enforceExistence: true
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-csslint");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-jscs");
grunt.registerTask("build", ["csslint", "jshint", "jscs"]);
};
I get this error:
Wrong returns value at ../../../target/classes/js/html/Aaa.js :
17 | Test.prototype.getState = function()
18 | {
19 | return {
-----------------^
20 | id: "main",
21 | state:
I think most of this configuration is meaningless (can be trimmed) but I am including it for the sake of completion.
from jscs-jsdoc.
Found a bug. ;-( Fixing... Thanks!
from jscs-jsdoc.
Merged into v0.0.21
@cowwoc Please check this
from jscs-jsdoc.
@zxqfox Works for me, thanks!
from jscs-jsdoc.
Related Issues (20)
- Separate checkTypes rule into checkTypes and checkNativeTypeCase HOT 1
- Add "trailingUnderscoreAccess" option
- requireDescriptionCompleteSentence is not allowed to be false or null HOT 1
- Support disabling rules in jsdoc HOT 10
- Parameter validation wrongly associates closure and doc block HOT 4
- requireDescriptionCompleteSentence: fails to recognize inlined links. HOT 2
- jsdoc incorrectly validates shorthand arrow functions with nested function signatures
- Merge checkParamNames and checkRedundantParams
- AssertionError with missing braces and multi-line description in @returns tag HOT 1
- Why can't support array[].property jsdoc syntax??
- Tags should be case insensitive HOT 2
- enforceExistence rule not work properly for anonymous function. HOT 3
- False positive "Unexpected data in tag constructor" for JSDuck HOT 1
- @listens tag is missing from jsdoc3.json
- Is there a way to switch off jsdoc enforceExistence for anonymous arrow functions? HOT 3
- Function is missing documentation for parameter `undefined` with default parameters HOT 1
- New Rule: enforce order of tags HOT 2
- Question : How to add custom code to check to jscs-jsdoc module? HOT 4
- an error with jsDoc HOT 1
- [Meta] Is this merging into ESLint? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jscs-jsdoc.