-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
report an error when a package imported in a @type
is not present in package.json
#896
Comments
Is this intended to catch the problem just a little earlier than running the compiler? Because TypeScript will, as I recall, report this kind of mistake if one is checking even plain JavaScript. |
@brettz9 its for transitive dependencies or globally installed packages which the typescript compiler won't catch. In my example with the |
Ok, and you care about adding dependencies directly in case the transitive ones are ever removed by other dependencies? |
Yep exactly. Another case I just remembered is when I remove a dependency from my |
…dencies for import statements; fixes gajus#896
…dencies for import statements; fixes gajus#896
…dencies for import statements; fixes gajus#896
…dencies for import statements; fixes gajus#896
…dencies for import statements; fixes #896
🎉 This issue has been resolved in version 46.2.0 🎉 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]>
Motivation
i use
import/no-extraneous-dependencies
to ensure that i don't accidentally install and import dependencies without adding topackage.json
.it would be nice to have that functionality in jsdoc
@type
s as wellCurrent behavior
no error when
eslint
and/or@types/eslint
is not present independencies
ordevDependencies
in `package.jsonDesired behavior
error
Alternatives considered
raised an issue on
eslint-plugin-import
but it was suggested that i raise it here as it's apparently not able to check jsdocs - import-js/eslint-plugin-import#2508 (comment)The text was updated successfully, but these errors were encountered: