jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 510 forks source link

jsDoc: Bug detecting periods in description #2056

Closed dharkness closed 8 years ago

dharkness commented 8 years ago

This function description is being flagged erroneously. The preceding line does indeed end in a period. Perhaps it's getting tripped up by the HTML?

jsDoc: You started a new line with an upper case letter but previous line does not end with a period at main.js :
539 |     *
540 |     * Any parameter value without a name is assigned the boolean value <code>true</code>.
541 |     * The first such parameter, going from left-to-right, is also assigned to a field named "_".
------------^
542 |     *
543 |     * @private

This happens when separating paragraphs using <p> as well. The suggestion in another issue to strip out HTML would solve it.

/**
 * Does this thing.
 *   <p>
 * Also does something else.
 */
markelog commented 8 years ago

/cc @zxqfox

kepta commented 8 years ago

@zxqfox I would love to work on this bug. Can could guide me on how to take this one?

qfox commented 8 years ago

@kepta It's a rule requireDescriptionCompleteSentence

https://github.com/jscs-dev/jscs-jsdoc/issues?utf8=✓&q=is%3Aissue+requireDescriptionCompleteSentence

The problem here that this rule based on regular expressions. I know this is not the best thing here but don't see any better solution atm.

Would be great if you'll tackle this. I'm even agree if you'll find some good library for that. I'm really confused atm how this rule should work internally.

qfox commented 8 years ago

Btw, we have another rules that close to this problem:

Probably we just should move out this rule to separate package with independent release cycle and spec.