eslint-plugin-export-scope icon indicating copy to clipboard operation
eslint-plugin-export-scope copied to clipboard

Grouped exports are not working as expect

Open AhmedBaset opened this issue 1 year ago • 10 comments

Thanks a lot for the incredible plugin.

I have a minor issue that doesn't seem to work as expected when grouping exports

/** @scope * */
const a = 1;
const b = 2;

/** @scope * */
export { a, b }

I've tried the first approach (tsDoc above the decleration and above the export statment. Both throws an error when importing.

When exporting at the same line of decleration, It works as expected.

AhmedBaset avatar Feb 25 '24 03:02 AhmedBaset

Good catch @A7med3bdulBaset! This type of export is not covered by the plugin at all. I'll try to find some time to add support for it in 2 weeks.

A-Shleifman avatar Feb 25 '24 03:02 A-Shleifman

@A7med3bdulBaset, try v2.1.0! Please let me know if there are still any issues.

A-Shleifman avatar Mar 15 '24 01:03 A-Shleifman

Thanks a million

Is there a possibility to investigate in performance? It makes both TypeScript and Eslint very slow

AhmedBaset avatar Mar 15 '24 11:03 AhmedBaset

Thank you for pointing this out! To validate dynamic and * as alias imports TS has to do a lot of work. I'll put those features behind a flag, so they're off by default, while I'm looking for a more performant way to validate those nodes.

A-Shleifman avatar Mar 15 '24 11:03 A-Shleifman

I understand how it slows down ESLint, but can you tell me how is it affecting TS performance?

A-Shleifman avatar Mar 15 '24 12:03 A-Shleifman

I understand how it slows down ESLint, but can you tell me how is it affecting TS performance?

to be honest, I'm not sure whether the slowness is in the TS or Eslint side. But the entire codebase is notably slow. e.g. import auto-completion, TS compiler crashes more, etc...

AhmedBaset avatar Mar 15 '24 21:03 AhmedBaset

I understand where performance issues could be coming from and I'm working on a solution, but I don't see any performance issues on my device. Do you have an older computer?

A-Shleifman avatar Mar 15 '24 21:03 A-Shleifman

Mine has Ryzen 5 5600 proccessor and 8GB, IMO it's not that old.

let's wait for your solution.

This issue could be closed

AhmedBaset avatar Mar 15 '24 22:03 AhmedBaset

@A7med3bdulBaset, I just released v2.2.0. It uses a completely different mechanism, so hopefully it will resolve perf issues. On my machine linting one project went down from 1,200ms to 120ms. If you have the time, please let me know if all issues are resolved or if there are any left.

A-Shleifman avatar Mar 18 '24 22:03 A-Shleifman

Awesome, I'll check ASAP and report back to you

I appreciate your work

AhmedBaset avatar Mar 21 '24 13:03 AhmedBaset