Closed
Description
#354 proposes adding a mode
setting for allowing different behavior between TypeScript, Closure, and regular jsdoc. This setting could be used for other tweaks:
- Avoid
parseClosureTemplateTag
inno-undefined-types
except forclosure
- Toggle
check-syntax
behavior (report non-GCC when in closure mode) - Start checking
module
for namepaths (see "todo" injsdocUtils.js
source), but only for "jsdoc" (and "closure"?) mode (TS doesn't support) -
valid-types
-
valid-types
- Ensure tags with optional type (tagsWithOptionalTypePosition
) only allow forpackage
,private
,protected
,public
, andstatic
if in closure mode. -
valid-types
- Only allow@extends {SomeType}
with brackets if in closure mode. -
valid-types
- Only allow@typedef {SomeType}
(without a name) in closure mode. - Report name on
@interface
in Closure
-
- Don't check optional name on
@interface
in Closure - For
check-tag-names
, avoid allowing@template
except inclosure
andtypescript
- For
check-tag-names
, add other GCC tags forclosure
mode (GCC specific tags support #306) -
check-tag-names
to prefer other defaults withtagNamePreference
(return
overreturns
) - See about getting jsdoctypeparser (e.g., see Typescript types should parse correctly jsdoctypeparser/jsdoctypeparser#50 on TypeScript support) to support different modes so long as jsdoc/TypeScript/Closure differ in the formats supported (might have comments which are used to build alternate versions of the peg file, e.g., stripping out those for TypeScript or Closure only). One explicitly desired rule to be avoided for closure per Disallow {[string]} array notation #495 is to disallow tuples. Might also have a tolerant version (the default?) which accepted all forms though (?).
Might accept a version in an array along with the mode string in case jsdoc, Closure, or TypeScript make breaking changes or add more features.