-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
imports-as-dependencies
doesn't detect missing @types
packages
#1107
Comments
Ugh, yeah, I really hadn't thought this through. I'm not sure how much detection we want to be doing, e.g., to know whether to check for |
I'm thinking I may need to remove the rule unless TypeScript provides an API for detection, since there is quite a bit involved here--e.g., |
import/no-extraneous-dependencies is able to detect this, maybe its worth looking at the source code for that rule to see how it works |
That appears to be able to look for type imports, but not checking whether declaration files are present. |
…d if not present, check `@types`; fixes gajus#1107
…nd if not present, check `@types`; fixes gajus#1107
Ok, I've submitted #1108 which should handle this. It doesn't |
…nd if not present, check `@types`; fixes gajus#1107
…nd if not present, check `@types`; fixes #1107
🎉 This issue has been resolved in version 46.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@brettz9 looks like it now errors on imports from packages that come with type definitions (ie. does not need a /** @type {import('typescript').Program} */ // error import points to package which is not found in dependencies jsdoc/imports-as-dependencies
const foo = {} in this case, i have |
With the exception of TypeScript itself (for which I can supply a fix), it should still be working for packages with their own types. TypeScript just doesn't have |
looks like typescript uses
|
🎉 This issue has been resolved in version 46.2.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | devDependencies | major | [`40.3.0` -> `46.2.4`](https://renovatebot.com/diffs/npm/eslint-plugin-jsdoc/40.3.0/46.2.4) | --- ### Release Notes <details> <summary>gajus/eslint-plugin-jsdoc</summary> ### [`v46.2.4`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v46.2.4) [Compare Source](gajus/eslint-plugin-jsdoc@v46.2.3...v46.2.4) ##### Bug Fixes - **`imports-as-dependencies`:** allow relative paths ([7469e59](gajus/eslint-plugin-jsdoc@7469e59)) ### [`v46.2.3`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v46.2.3) [Compare Source](gajus/eslint-plugin-jsdoc@v46.2.2...v46.2.3) ##### Bug Fixes - **`imports-as-dependencies`:** catch `typings` as possible publishing source ([e3b0d0c](gajus/eslint-plugin-jsdoc@e3b0d0c)) ### [`v46.2.2`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v46.2.2) [Compare Source](gajus/eslint-plugin-jsdoc@v46.2.1...v46.2.2) ##### Bug Fixes - **`imports-as-dependencies`:** don't report TypeScript proper ([75b6b8c](gajus/eslint-plugin-jsdoc@75b6b8c)) ### [`v46.2.1`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v46.2.1) [Compare Source](gajus/eslint-plugin-jsdoc@v46.2.0...v46.2.1) ##### Bug Fixes - **`imports-as-dependencies`:** check for `types` in `package.json` and if not present, check `[@types](https://github.com/types)`; fixes [#​1107](gajus/eslint-plugin-jsdoc#1107) ([785fb26](gajus/eslint-plugin-jsdoc@785fb26)) ### [`v46.2.0`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v46.2.0) [Compare Source](gajus/eslint-plugin-jsdoc@v46.1.0...v46.2.0) ##### Features - **`imports-as-dependencies`:** add new rule to detect missing dependencies for import statements; fixes [#​896](gajus/eslint-plugin-jsdoc#896) ([d7ec6e0](gajus/eslint-plugin-jsdoc@d7ec6e0)) ### [`v46.1.0`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v46.1.0) [Compare Source](gajus/eslint-plugin-jsdoc@v46.0.0...v46.1.0) ##### Features - **`require-returns`:** per-context `forceRequireReturn`; fixes [#​757](gajus/eslint-plugin-jsdoc#757) ([31b3a24](gajus/eslint-plugin-jsdoc@31b3a24)) ### [`v46.0.0`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v46.0.0) [Compare Source](gajus/eslint-plugin-jsdoc@v45.0.0...v46.0.0) ##### Features - **`no-defaults`:** make no-defaults on by default ([034ade1](gajus/eslint-plugin-jsdoc@034ade1)) ##### BREAKING CHANGES - **`no-defaults`:** Removes default values. Disable the rule if removal not desired. Also: - docs: adds info on TS recommended rules ### [`v45.0.0`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v45.0.0) [Compare Source](gajus/eslint-plugin-jsdoc@v44.2.7...v45.0.0) ##### Features - add recommended-typescript-flavor configs ([6042b77](gajus/eslint-plugin-jsdoc@6042b77)) - for typescript configs, disable `no-undefined-types`; fixes [#​888](gajus/eslint-plugin-jsdoc#888) ([ec41b90](gajus/eslint-plugin-jsdoc@ec41b90)) ##### BREAKING CHANGES - This should only impact users of typescript configs. TS should itself handle checking for undefined types, so the (imperfect) rule has been disabled for such users. ### [`v44.2.7`](gajus/eslint-plugin-jsdoc@v44.2.6...v44.2.7) [Compare Source](gajus/eslint-plugin-jsdoc@v44.2.6...v44.2.7) ### [`v44.2.6`](gajus/eslint-plugin-jsdoc@v44.2.5...v44.2.6) [Compare Source](gajus/eslint-plugin-jsdoc@v44.2.5...v44.2.6) ### [`v44.2.5`](gajus/eslint-plugin-jsdoc@v44.2.4...v44.2.5) [Compare Source](gajus/eslint-plugin-jsdoc@v44.2.4...v44.2.5) ### [`v44.2.4`](gajus/eslint-plugin-jsdoc@v44.2.3...v44.2.4) [Compare Source](gajus/eslint-plugin-jsdoc@v44.2.3...v44.2.4) ### [`v44.2.3`](gajus/eslint-plugin-jsdoc@v44.2.2...v44.2.3) [Compare Source](gajus/eslint-plugin-jsdoc@v44.2.2...v44.2.3) ### [`v44.2.2`](gajus/eslint-plugin-jsdoc@v44.2.1...v44.2.2) [Compare Source](gajus/eslint-plugin-jsdoc@v44.2.1...v44.2.2) ### [`v44.2.1`](gajus/eslint-plugin-jsdoc@v44.2.0...v44.2.1) [Compare Source](gajus/eslint-plugin-jsdoc@v44.2.0...v44.2.1) ### [`v44.2.0`](gajus/eslint-plugin-jsdoc@v44.1.0...v44.2.0) [Compare Source](gajus/eslint-plugin-jsdoc@v44.1.0...v44.2.0) ### [`v44.1.0`](gajus/eslint-plugin-jsdoc@v44.0.2...v44.1.0) [Compare Source](gajus/eslint-plugin-jsdoc@v44.0.2...v44.1.0) ### [`v44.0.2`](gajus/eslint-plugin-jsdoc@v44.0.1...v44.0.2) [Compare Source](gajus/eslint-plugin-jsdoc@v44.0.1...v44.0.2) ### [`v44.0.1`](gajus/eslint-plugin-jsdoc@v44.0.0...v44.0.1) [Compare Source](gajus/eslint-plugin-jsdoc@v44.0.0...v44.0.1) ### [`v44.0.0`](gajus/eslint-plugin-jsdoc@v43.2.0...v44.0.0) [Compare Source](gajus/eslint-plugin-jsdoc@v43.2.0...v44.0.0) ### [`v43.2.0`](gajus/eslint-plugin-jsdoc@v43.1.1...v43.2.0) [Compare Source](gajus/eslint-plugin-jsdoc@v43.1.1...v43.2.0) ### [`v43.1.1`](gajus/eslint-plugin-jsdoc@v43.1.0...v43.1.1) [Compare Source](gajus/eslint-plugin-jsdoc@v43.1.0...v43.1.1) ### [`v43.1.0`](gajus/eslint-plugin-jsdoc@v43.0.9...v43.1.0) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.9...v43.1.0) ### [`v43.0.9`](gajus/eslint-plugin-jsdoc@v43.0.8...v43.0.9) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.8...v43.0.9) ### [`v43.0.8`](gajus/eslint-plugin-jsdoc@v43.0.7...v43.0.8) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.7...v43.0.8) ### [`v43.0.7`](gajus/eslint-plugin-jsdoc@v43.0.6...v43.0.7) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.6...v43.0.7) ### [`v43.0.6`](gajus/eslint-plugin-jsdoc@v43.0.5...v43.0.6) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.5...v43.0.6) ### [`v43.0.5`](gajus/eslint-plugin-jsdoc@v43.0.4...v43.0.5) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.4...v43.0.5) ### [`v43.0.4`](gajus/eslint-plugin-jsdoc@v43.0.3...v43.0.4) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.3...v43.0.4) ### [`v43.0.3`](gajus/eslint-plugin-jsdoc@v43.0.2...v43.0.3) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.2...v43.0.3) ### [`v43.0.2`](gajus/eslint-plugin-jsdoc@v43.0.1...v43.0.2) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.1...v43.0.2) ### [`v43.0.1`](gajus/eslint-plugin-jsdoc@v43.0.0...v43.0.1) [Compare Source](gajus/eslint-plugin-jsdoc@v43.0.0...v43.0.1) ### [`v43.0.0`](gajus/eslint-plugin-jsdoc@v42.0.0...v43.0.0) [Compare Source](gajus/eslint-plugin-jsdoc@v42.0.0...v43.0.0) ### [`v42.0.0`](gajus/eslint-plugin-jsdoc@v41.1.2...v42.0.0) [Compare Source](gajus/eslint-plugin-jsdoc@v41.1.2...v42.0.0) ### [`v41.1.2`](gajus/eslint-plugin-jsdoc@v41.1.1...v41.1.2) [Compare Source](gajus/eslint-plugin-jsdoc@v41.1.1...v41.1.2) ### [`v41.1.1`](gajus/eslint-plugin-jsdoc@v41.1.0...v41.1.1) [Compare Source](gajus/eslint-plugin-jsdoc@v41.1.0...v41.1.1) ### [`v41.1.0`](gajus/eslint-plugin-jsdoc@v41.0.0...v41.1.0) [Compare Source](gajus/eslint-plugin-jsdoc@v41.0.0...v41.1.0) ### [`v41.0.0`](gajus/eslint-plugin-jsdoc@v40.3.0...v41.0.0) [Compare Source](gajus/eslint-plugin-jsdoc@v40.3.0...v41.0.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjExMS4wIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCJ9--> Co-authored-by: cabr2-bot <[email protected]> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1913 Reviewed-by: Epsilon_02 <[email protected]> Co-authored-by: Calciumdibromid Bot <[email protected]> Co-committed-by: Calciumdibromid Bot <[email protected]>
thanks for adding the rule i suggested in #896! i noticed that it doesn't seem to detect
@types/
packages thoughExpected behavior
error because
@types/eslint
is not independencies
ordevDependencies
Actual behavior
no error
ESLint Config
ESLint sample
source code
package.json
Environment
eslint-plugin-jsdoc
version: 46.2.0The text was updated successfully, but these errors were encountered: