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

feat(extract): adds recognition of jsdoc 'bracket' imports #969

Merged
merged 6 commits into from
Dec 1, 2024

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Nov 24, 2024

Description

  • adds recognition for the 'older' bracket style imports in jsdoc
    (so things like /** @type {import('thing')} */, /** @typedef {import('thing')} Thing */, /** @param {import('thing')} pParameter blablabla */, ...)
  • updates documentation to reflect that it isn't a 'future feature' anymore
  • 🏕️ drive-by: updates jsdoc type references in dependency-cruiser's own sources

TODO

  • Add support for more exotic ways to import (e.g. /** @type {Partial<import('bla')>} */, /** @type{boolean|import('bla')|import('ble')} */, /** {Set<string,Partial<import('bla')>} */, ...)
  • Verify with the list of jsdoc tag types typescript supports there's no other corner cases that can bite us.
  • so... we currently seem to occasionally resolve these type only imports to the real implementation. Is that an issue?

Note

an iteration of this pull request has been published as a beta on npmjs

Motivation and Context

How Has This Been Tested?

  • green ci
  • additional unit tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation only change
  • Refactor (non-breaking change which fixes an issue without changing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • 📖

    • My change doesn't require a documentation update, or ...
    • it does and I have updated it
  • ⚖️

    • The contribution will be subject to The MIT license, and I'm OK with that.
    • The contribution is my own original work.
    • I am ok with the stuff in CONTRIBUTING.md.

@sverweij sverweij marked this pull request as draft November 24, 2024 19:03
@sverweij sverweij force-pushed the feature/adds-recognition-of-jsdoc-bracket-imports branch from bf9dd79 to 85bbc24 Compare November 27, 2024 19:28
Up'em just updated these outdated dependencies in package.json:

@swc/core                      1.7.42   -> 1.9.3   devDependencies   (policy: latest)
@types/node                    22.8.7   -> 22.9.3  devDependencies   (policy: latest)
@vue/compiler-sfc              3.5.12   -> 3.5.13  devDependencies   (policy: latest)
husky                          9.1.6    -> 9.1.7   devDependencies   (policy: latest)
svelte                         5.1.9    -> 5.2.7   devDependencies   (policy: latest)
tsconfig-paths-webpack-plugin  4.1.0    -> 4.2.0   dependencies      (policy: latest)
typescript                     5.6.3    -> 5.7.2   devDependencies   (policy: latest)
watskeburt                     4.1.0    -> 4.1.1   dependencies      (policy: latest)
@sverweij sverweij force-pushed the feature/adds-recognition-of-jsdoc-bracket-imports branch from 85bbc24 to b4664b6 Compare November 30, 2024 11:52
Copy link

codeclimate bot commented Dec 1, 2024

Code Climate has analyzed commit 41d2e71 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link

sonarqubecloud bot commented Dec 1, 2024

@sverweij sverweij marked this pull request as ready for review December 1, 2024 19:25
@sverweij sverweij merged commit 0d49477 into main Dec 1, 2024
9 checks passed
@sverweij sverweij deleted the feature/adds-recognition-of-jsdoc-bracket-imports branch December 1, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant