question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhancement: valid-jsdoc: Allow the omission of @returns when @chainable tag specified

See original GitHub issue

We make use YUIdoc documentation format, and have found the valid-jsoc rule fine for checking the yuidoc, one small niggle is that we make use of the @chainable tag and that implies that a @return tag is not necessary.

I understand this is not really standard jsdoc variant so is a controversial request. In support of my request is that I see some people are keen to support this syntax in jsdoc and are already using this syntax in the wild.

The version of ESLint you are using 3.0.1 The rule you want to change valid-jsoc The code you want to be flagged as correct

/* eslint valid-jsdoc: [“error”, { “allowChainable”: true }] */

/**
 * Renders this view …
 * @chainable
 */
function render() {
     // do stuff
     return this; 
}

What happens when the rule is applied to the code without your change Missing JSDoc @returns for function. (valid-jsdoc)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Jul 18, 2016

In order to avoid hardcoding YUIDoc-specific logic into the rule, we could consider adding an option for tag synonyms. Something like:

valid-jsdoc: ["error", { synonyms: { "return": "chainable" } { ]

I’d champion such a change as I think it will make other instances of similar problems easier.

0reactions
kaicataldocommented, Jan 9, 2017

Understand the confusion. By “reaching consensus” I mean the process of accepting the issue (which the team has decided requires a champion and three upvotes from the team). Can definitely make that clearer in the future.

We’ve found that issues that get buried in the backlog without getting accepted end up getting lost (as can be evidenced by the lack of discussion here). Keeping our issues backlog manageable is necessary for keeping the project moving forward, both for us maintainers and also for our contributors.

Feel free to open a new issue with your proposal - chances are much higher it’ll get some attention when it’s not multiple pages deep into our issues list!

Read more comments on GitHub >

github_iconTop Results From Across the Web

valid-jsdoc - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
How to Write Doc Comments for the Javadoc Tool
This document describes the style guide, tag and image conventions we use in documentation comments for Java programs written at Java Software, Oracle....
Read more >
The source code
@return {Mixed|Object|null} If selection was a string, returns the value, ... eslint-disable-next-line valid-jsdoc /** * Add (does not replace) parameters ...
Read more >
Joshua's Docs - JSDoc Cheatsheet and Type Safety Tricks
Cheatsheet on using JSDoc, especially with VSCode, and some tips on type safety and advanced usage.
Read more >
eslint-config-ash-nazg
eslint-plugin-jsdoc - provides a number of helpful rules for catching bad or incomplete JSDoc during development. Note that we do not impose jsdoc/require-jsdoc...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found