Skip to content

Global JSDoc in ESM imports do not count #637

@michaelfig

Description

@michaelfig

Expected behavior

The plugin should be able to load global JSDoc types defined in different files, whether by ESM import or (as in the Typescript language server), just because they are in the same directory.

Actual behavior

Typescript and the Typescript language server properly find the global JSDoc types in separate files.

For eslint-plugin-jsdoc, global JSDoc types in separate files are not loaded. Types defined in them show up the IDE as:
Screen Shot 2020-09-12 at 1 01 56 PM
and in the eslint run as: https://gist.github.com/michaelfig/dc4c5665e9259f5316e35885567daa6b#file-eslint-log

This prevents modularity in defining types, but more importantly, this forces me to turn off the (otherwise useful) jsdoc/no-undefined-types rule to suppress the hundreds of false-positives I get.

ESLint Config

https://gist.github.com/michaelfig/dc4c5665e9259f5316e35885567daa6b#file-package-json

ESLint sample

https://gist.github.com/michaelfig/dc4c5665e9259f5316e35885567daa6b

Environment

  • Node version: 12.14.1
  • ESLint version v7.8.1
  • eslint-plugin-jsdoc version: 30.4.2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions