Enhancement: valid-jsdoc: Allow the omission of @returns when @chainable tag specified
See original GitHub issueWe 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:
- Created 7 years ago
- Comments:13 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In order to avoid hardcoding YUIDoc-specific logic into the rule, we could consider adding an option for tag synonyms. Something like:
I’d champion such a change as I think it will make other instances of similar problems easier.
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!