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

no-undefined-types: Include instance property names in the set of defined types #1119

Open
kraenhansen opened this issue Jun 21, 2023 · 1 comment

Comments

@kraenhansen
Copy link
Contributor

Expected behavior

I would like to be able to reference instance properties from an inline {@link ...} tag on a class and have the no-undefined-types rule recognise this as a defined type.

Actual behavior

Referencing an instance property name in an inline {@link } tag yields

The type 'foo' is undefined.

ESLint Config

{
  "parserOptions": {
    "ecmaVersion": "latest"
  },
  "extends": [
    "plugin:jsdoc/recommended"
  ],
  "rules": {
    "jsdoc/no-undefined-types": "warn"
  }
}

ESLint sample

class Foo {
  foo = "foo";
  /**
   * Something related to {@link foo}
   * @returns {string} Something awesome
   */
  bar() {
    return "bar";
  }
}

Environment

  • Node version: v18.9.0
  • ESLint version v8.43.0
  • eslint-plugin-jsdoc version: v46.2.6
@unicornware
Copy link

also having this issue. it's preventing me from upgrading: https://github.com/flex-development/tutils/actions/runs/5439784079/jobs/9892093691?pr=296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants