Skip to content

no-unused-exports rule shows an false error when using destructured array exports: exported declaration 'undefined' not used within other modules #2930

@emreboga

Description

@emreboga

This issue is result of an incomplete fix for #2037.
Reposting my comment here for visibility:

I don't think the issue was fully fixed by #1997 as it only addresses object type destucturing, not including array types. You can see it in the code:
https://github.com/import-js/eslint-plugin-import/pull/1997/files#diff-7d2908b010ec724c0f3a0d7615cb91f4673d765d52c6ba6607501e23470f2966R85

I'm seeing this in the code with the version 2.28.1, which has the fix with #1997. Here is a code chunk I have:

export const [authUserLoading, authUserError] = createLoadingAndErrorSelectors(
  AUTH_USER
);

and here is the error I get:

error exported declaration 'undefined' not used within other modules import/no-unused-modules

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions