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

[Fix] no-extraneous-dependencies: ignore export type { ... } from '...' when includeTypes is false #2919

Merged
merged 1 commit into from Nov 17, 2023

Conversation

Pandemic1617
Copy link
Contributor

Summary

The no-extraneous-dependencies rule still checks a the dependency of export type { T } from 'a-dev-dependency' even when it is supposed to exclude type only imports

Example

This triggers an error

export type { T } from "a-dev-dependency";

This doesn't

import type { T } from "a-dev-dependency"; 
export type { T };

package.json

{
    "devDependencies": {
        "a-dev-dependency": "*"
    }
}

rule:

{
    "devDependencies": false,
    "includeTypes": false // false by default
 }

Fix

Check if the export statement's kind is type and if so, treat it like an import type statement.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@ljharb ljharb changed the title fix: no-extraneous-dependencies: ignore export type { ... } from '...' when includeTypes is false [Fix] no-extraneous-dependencies: ignore export type { ... } from '...' when includeTypes is false Nov 12, 2023
@ljharb ljharb merged commit 12f0300 into import-js:main Nov 17, 2023
174 of 175 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants