Closed unicornware closed 1 year ago
My suggestion is, don't use eslint-plugin-jsdoc
and prettier-plugin-jsdoc
both.
@hosseinmd
given #161, i’ve already opted for removing prettier-plugin-jsdoc
. that’s not really a solution in my book, however, nor is it even a solution at all for folks already not using eslint-plugin-jsdoc
.
if you take a look at the jsdoc website, you'll see that some block tags have synonyms.
@return
is a synonym for @returns
, as is @const
for @constant
the tagNamePreference
setting is support for synonyms. so for devs using synonyms, but not eslint-plugin-jsdoc
, they too will encounter faulty errors because prettier-plugin-jsdoc
does not have the same support. simply banning synonym usage would not be a viable solution either.
@hosseinmd
if synonyms are truly supported, it doesn't make sense to me why this plugin doesn't work with eslint-plugin-jsdoc
, which makes this seem like more of a bug.
how does this library determine a tag is valid? are the keys of TAGS_SYNONYMS
included in that validation?
if i'm interpreting your comment correctly, i don't think the keys are being included as valid tags.
One TAG TYPE can have different titles called SYNONYMS. We want to avoid different titles in the same tag so here is map with...[what] we want to have in final jsDoc.
it's one thing to enforce consistency (using the original tag or the synonym, but not both), but it seems to me that the library is purposely excluding synonyms from being used at all. it's attempting to force the use of the original tag with zero regard for what's in my codebase (i use @const
and @return
consistently). my suggestion would be to implement an option similar to tagNamePreference
, or at least something where the map is somehow user-provided. this way, consistency (if that is the intention) is dictated by the user.
The main aim of synonyms is creating a standard for tags name, I don't want to create option for this, you should move to this standard because of consistency between packages. Maybe these synonyms don't have a reason, but used in many packages, we want to have a consistency between packages.
If you think these synonyms isn't good, I agree with you, give us your suggestion we could fix it if others accept.
we want to have a consistency between packages
Please don't make that a goal of this project. Its main value is consistency within a codebase and making it inflexible makes it harder to adopt into codebases. The default settings suffice to nudge people towards your chosen norms.
Please don't make that a goal of this project. Its main value is consistency within a codebase and making it inflexible makes it harder to adopt into codebases. The default settings suffice to nudge people towards your chosen norms.
Yes you are totaly right. but implemention is hard, some logic was hard code,
Description
I'm attempting to integrate this plugin into my workflow, but it doesn't seem the plugin is integrated with
eslint-plugin-jsdoc
, nor eslint itself.Specifically, the lack of support for the
tagNamePreference
setting ineslint-plugin-jsdoc
results in faulty errors regarding tags.I'm not entirely sure, but I also suspect that the lack of integration with eslint (or maybe
prettier-vscode
?) means the following:eslint
eslint
to get a full reporteslint --fix
insteadExample
tagNamePreference
settings:Take the following file:
After running
eslint ./src/katas/tribonacci.ts --exit-on-fatal-error --report-unused-disable-directives --fix
:17:11
: the plugin wants me to use@returns
=> my settings dictate using@return
26:12
: the plugin wants me to use@constant
=> my settings dictate using@const