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

Global JSDoc in ESM imports do not count #637

Closed
michaelfig opened this issue Sep 12, 2020 · 1 comment
Closed

Global JSDoc in ESM imports do not count #637

michaelfig opened this issue Sep 12, 2020 · 1 comment

Comments

@michaelfig
Copy link

michaelfig commented Sep 12, 2020

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
@brettz9
Copy link
Collaborator

brettz9 commented Sep 13, 2020

Dupe of #99 . That issue wouldn't address checking the same directory, but detection via import and other means, so closing.

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

2 participants