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

no-unused-exports bug with export * from syntax #24

Closed
omothm opened this issue Aug 21, 2023 · 3 comments
Closed

no-unused-exports bug with export * from syntax #24

omothm opened this issue Aug 21, 2023 · 3 comments

Comments

@omothm
Copy link

omothm commented Aug 21, 2023

When a file uses the syntax

export * from "./file.ts";

where file.ts contains more than one export on separate lines, the rule throws a RangeError.

Minimal reproduction: https://github.com/omothm/no-unused-exports-export-from-bug-repro

@AnasShahid
Copy link

Any update on resolution of this issue?

@AnasShahid
Copy link

A simple workaround I did was to exclude the barrel file from eslint using tsconfig.eslint.json file. Here's the sample tsconfig.eslint.json file:

{ "extends": "./tsconfig.json", "include": [ "src/**/*.ts", "*.ts", "test/**/*.ts" ], "exclude": [ "node_modules", "dist", ".eslintrc.js", "src/**/index.ts" // Removing barrel file from eslint because 'export *' syntax conflicts with the cononical/no-unused-exports rule. ] }

@gajus
Copy link
Owner

gajus commented Dec 18, 2024

I encourage to migrate to https://knip.dev/

@gajus gajus closed this as completed Dec 18, 2024
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

No branches or pull requests

3 participants