Skip to content

JSDoc/GCC/TypeScript mode #356

Closed
Closed
@brettz9

Description

@brettz9

#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 in no-undefined-types except for closure
  • Toggle check-syntax behavior (report non-GCC when in closure mode)
  • Start checking module for namepaths (see "todo" in jsdocUtils.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 for package, private, protected, public, and static 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 in closure and typescript
  • For check-tag-names, add other GCC tags for closure mode (GCC specific tags support #306)
  • check-tag-names to prefer other defaults with tagNamePreference (return over returns)
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions