-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(extract): adds recognition of jsdoc 'bracket' imports (#969)
## 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 - [x] 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')>} */`, ...) - [x] Verify with [the list of jsdoc tag types typescript supports](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) there's no other corner cases that can bite us. - [x] 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](https://www.npmjs.com/package/dependency-cruiser/v/16.7.0-beta-2) ## Motivation and Context - necessary to be more complete than just `@import` tags (see #964 and #965) - needs to be introduced at the same time as those to prevent a breaking change ## How Has This Been Tested? - [x] green ci - [x] 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) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change)
- Loading branch information
Showing
14 changed files
with
403 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -303,4 +303,4 @@ | |
"vue-template-compiler": ">=2.0.0 <3.0.0", | ||
"@vue/compiler-sfc": ">=3.0.0 <4.0.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.