Skip to content
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

@inheritDoc broken with v23 release #520

Closed
vapier opened this issue Apr 20, 2020 · 3 comments
Closed

@inheritDoc broken with v23 release #520

vapier opened this issue Apr 20, 2020 · 3 comments
Labels

Comments

@vapier
Copy link

vapier commented Apr 20, 2020

it looks like v23 started requiring @inheritdoc and ignoring @inheritDoc (notice capitalization) when using closure mode. while the jsdoc spec uses lowercase, closure does not. trying to use @inheritdoc with closure throws an error.

example code snippet:

/** @abstract */
class base {
  /** @param {boolean} arg0 */
  constructor(arg0) {}
}

class foo extends base {
  /** @inheritDoc */
  constructor(arg0) {
    super(arg0);
    this.arg0 = arg0;
  }
}

using v22 and older this works fine. starting with v23, it errors:

.../test.js
  8:3  warning  Missing JSDoc @param "arg0" declaration  jsdoc/require-param

here's my .eslintrc.js settings:

  'rules': {
    'jsdoc/check-alignment': 2,
    'jsdoc/check-examples': 2,
    'jsdoc/check-indentation': 0,
    'jsdoc/check-param-names': 2,
    'jsdoc/check-syntax': 0,  
    'jsdoc/check-tag-names': 2,
    'jsdoc/check-types': 0, 
    'jsdoc/implements-on-classes': 2,
    'jsdoc/newline-after-description': 2,
    'jsdoc/no-types': 0,
    'jsdoc/require-description': 0,
    'jsdoc/require-description-complete-sentence': 0,
    'jsdoc/require-example': 0,
    'jsdoc/require-hyphen-before-param-description': ['error', 'never'],
    'jsdoc/require-jsdoc': 0,
    'jsdoc/require-param': 1,
    'jsdoc/require-param-description': 0,
    'jsdoc/require-param-name': 2,
    'jsdoc/require-param-type': 2,
    'jsdoc/require-returns': 2,
    'jsdoc/require-returns-check': 2,
    'jsdoc/require-returns-description': 0,
    'jsdoc/require-returns-type': 2,
    'jsdoc/valid-types': 0,
  },

  'settings': {
    'jsdoc': {
      'mode': 'closure',
      'preferredTypes': {
        'object': 'Object',
      },
      'tagNamePreference': {
        'augments': 'extends',
        'constant': 'const',
        'class': 'constructor',
        'file': 'fileoverview',
        'returns': 'return',
      },
    },
  },
@brettz9
Copy link
Collaborator

brettz9 commented Apr 20, 2020

Thank you for the report. I've fixed this case.

In some cases internally (our internal hasTag (and therefore also hasATag/hasPreferredTag) internal checks), we are lower-casing before doing comparisons, and I wonder if we should stop doing that (except in cases as inheritDoc where it is known to differ), but I hesitate to break things if projects are using different casings. Does anyone know if jsdoc itself is forgiving as to casing?

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Apr 20, 2020
…-example, require-param, require-returns) explicitly allow `inheritDoc` in all modes while only allowing `inheritdoc` in non-Closure mode; fixes gajus#520"

This reverts commit 81164fd.
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Apr 20, 2020
…, require-param, require-returns): explicitly allow `inheritDoc` in all modes while only allowing `inheritdoc` in non-Closure mode; fixes gajus#520
@brettz9
Copy link
Collaborator

brettz9 commented Apr 20, 2020

I'm not sure what is wrong with the commit message such that semantic release has not put out a new release for this, but I have some other changes I hope to commit soon which should hopefully trigger a release (which includes this as well).

@gajus
Copy link
Owner

gajus commented Apr 20, 2020

🎉 This issue has been resolved in version 24.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants