-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Options to validate descriptions more precisely based on the specific tag #233
Comments
gajus#233 1. Make `constructs` disallow type (but optional name) 2. Require namepath and disallow type for `emits`; 3. Disallow type on `exports` except in closure/permissive modes; 4. Disallow type on `external` and `host` 5. Disallow type on `fires` but require name 6. Specify name as optional but type required on `function` 7. `listens`: should not have a type but must have a name 8. Make `miixin` name optional but disallow type 9. `requires` must have name but not have a type 10. `exports` must have a name in jsdoc mode 11. `interface`: disallow type
as a matter of fact, using {@link myMethod} breaks if it references a method from another class and complains about the incorrect reference. Meanwhile, vscode's intellisense can read those statements just fine. I'm using that a lot lately when I create helper methods to link back to the main method in the description part of the jsdoc |
…ore desc-like tags by default; check non-empty tags; gajus#233
…ore desc-like tags by default; check non-empty tags; gajus#233
…ore desc-like tags by default; check non-empty tags; gajus#233
…ore desc-like tags by default; check non-empty tags; gajus#233
…ore desc-like tags by default; check non-empty tags; gajus#233
…ore desc-like tags by default; check non-empty tags; #233
I was hoping I could define text content in |
For validating against specific strings, you can use 'jsdoc/match-description': ['error', {tags: {edition: '^(?:CORE|PRO|PLAT)$'}}] Regarding tags with no text/type content beyond the tag itself, you can use |
Thanks I'll use that approach for now, however I think centralizing all custom tag config in the settings has merit. Esp. since they are otherwise split up between multiple rule sets. Ex. empty tags, check-tag-names, match-description... |
Note: This needs to be reviewed, as others not marked as such may have since been implemented.
This is a request for a rule to validate descriptions more precisely based on the tag.
While this would be a lot of work, here is one more immediate to-do:
no-undefined-types
might use the pattern ofvalid-types
to check for types within tags recognized as having a type.require-description
,require-description-complete-sentence
, and especiallymatch-description
(see below)Ported from eslint/eslint#11043
When a JSDoc code comment has certain tags present elsewhere in a block (and which is not one of those covered by the function/class-based detection of the current behavior), a description that fails to match the regular expression of
matchDescription
(or equivalent separate config) should also be able to apply.Note that some of these may now be possible in
match-description
, though perhaps these as possibilities may be made explicit there.These tags should, as I see it, be comprised of:
@module
,@mixin
,@namespace
,@external
/@host
@typedef
,@event
objects may also be of enough importance for a description@interface
if present should call for a description, particularly when within virtual comments where the lack of an associated function or class would necessitate its own warning@global
,@kind
and@type
@variation
,@version
, and@since
, though more concrete, typically are associated with documentation as wellBesides certain tags flagging the need for a description by their presence, certain other tags require a description and I think there should be an option for
matchDescription
to match within these tags.@summary
and@file
/@fileoverview
/@overview
, fields which are descriptive in content and broad in purpose@classdesc
can occur separately from a class, e.g., as its own separate comment, and if so, its text should also be queryable.@copyright
,@example
,@see
,@todo
also have descriptive text areas which should never or rarely be empty;@throws
/@exception
,@yields
/@yield
and@property
/@prop
do likewise along with a possible type (and@property
/@prop
with a name as well)@deprecated
might be better filled (to point to a replacement)@throws
,@exception
)Other tags may expect something additional and would be worthy of having a rule, but are less like "descriptions":
@author
(with name and email; partly implemented but could allow checking againstpackage.json
contributors
andauthor
fields)@class
(optional),@constructs
(optional));@event
or@fires
/@emits
or@listens
(<className>#[event:]<eventName>
),@exports
,@external
/@host
,@function
(optional),@interface
,@mixin
,@requires
@kind
) feat(check-values
): add checking ofkind
#837@enum
(optional),@implements
;@package
(for Closure only),@private
(for Closure only),@protected
(for Closure only); not@public
or@static
for Closure?;@throws
/@exception
,@type
,@typedef
(type and name path))@constant
/@const
(optional),@member
/@var
,@module
,@namespace
)@alias
,@augments
/@extends
,@borrows
(namepath "as" namepath),@callback
,@lends
,@memberof
,@mixes
,@name
,@see
,@this
,@tutorial
)@default
/@defaultvalue
) Lint default param/property values and@default
/@defaultvalue
#473@license
,@since
,@version
)@access
(package|private|protected|public)@link
/@linkcode
/@linkplain
)@tutorial
should point to config file tutorial IDs)...and thus seem less like "descriptions" as per the rule name under discussion).
And a few seem they might benefit from insisting on no description as they don't seem to allow it:
@abstract
,@async
,@generator
,@global
,@hideconstructor
,@ignore
,@inheritdoc
,@inner
,@instance
,@override
,@readonly
(and see access types above referencing Closure under types above)Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: