A-Shleifman / eslint-plugin-export-scope

Disallows importing scoped exports outside their scope
https://www.npmjs.com/package/eslint-plugin-export-scope
110 stars 0 forks source link

Grouped exports are not working as expect #5

Closed AhmedBaset closed 4 months ago

AhmedBaset commented 7 months ago

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.

A-Shleifman commented 7 months ago

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 commented 6 months ago

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

AhmedBaset commented 6 months ago

Thanks a million

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

A-Shleifman commented 6 months ago

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 commented 6 months ago

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

AhmedBaset commented 6 months ago

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...

A-Shleifman commented 6 months ago

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?

AhmedBaset commented 6 months ago

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

A-Shleifman commented 6 months ago

@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.

AhmedBaset commented 6 months ago

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

I appreciate your work