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(ng-dev/ts-circular-dependencies): support ignoring type only imports/exports for circular dependency checks #772

Closed

Conversation

josephperrott
Copy link
Member

By setting a configuration, imports/exports which use the type keyword to indicate they are type-only imports/exports
are ignored with respect to circular dependency checks.

This circular dependency would be considered a circular dependency by the tool:

File 1:

import type {symbol} from './file-2';

export const coolSymbol: boolean = true;
...

File 2:

import {coolSymbol} from './file-1';

export const symbol: Symbol =  Symbol();
...

By enabling ignoreTypeOnlyChecks, the type import is ignored, resulting in no circular dependency.

…orts/exports for circular dependency checks

By setting a configuration, imports/exports which use the `type` keyword to indicate they are type-only imports/exports
are ignored with respect to circular dependency checks.
@josephperrott josephperrott added action: merge The PR is ready for merge by the caretaker action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 16, 2022
…nly imports/exports for circular dependency checks
@josephperrott josephperrott removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 17, 2022
public extensions: string[] = DEFAULT_EXTENSIONS,
) {}
) {
this._ignoreTypeOnlyChecks = !!ignoreTypeOnlyChecks;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now you can also spare the extra assignment and member declaration by just marking it e.g. as private in the constructor (that was mostly why I preferred the simple parameter)

@angular-robot
Copy link
Contributor

angular-robot bot commented Aug 17, 2022

This PR was merged into the repository by commit 682adb7.

@angular-robot angular-robot bot closed this in 682adb7 Aug 17, 2022
@josephperrott josephperrott deleted the support-ignoring-type-only branch August 17, 2022 21:13
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants