eslint / config-inspector

A visual tool for inspecting and understanding your ESLint flat configs.
https://www.npmjs.com/package/@eslint/config-inspector
Apache License 2.0
518 stars 15 forks source link

Inspector hangs on load #31

Closed Xiot closed 2 months ago

Xiot commented 2 months ago

When loading up the inspector webpage, it seems to be stuck in an infinite loop

I see this in the console, and the browser tab is pegged at 100%.

CleanShot 2024-04-07 at 11 10 27@2x

I'm still on eslint@npm:8.56.0, but have migrated to the flat config.
I was originally having this issue yesterday as well, but it seemed to fix itself at some point, and now it is back to hanging.

antfu commented 2 months ago

It seems like a browser extension you have? Or, can you share a minimal reproduction?

Xiot commented 2 months ago

I just tried in an incognito window (Chrome 123.0.6312.87 on MacOS) and I got the same thing.

Unfortunately its happening on my private monorepo, but I'll see if I can reproduce it elsewhere

Xiot commented 2 months ago

I was able to capture a trace with Firefox, and the page eventually does become intractable in about 25s. It looks like most of the time is spent transforming the globs to regex.

A bunch of the globs that I'm using in my eslint.config.js are built up from the includes from my tsconfig.json files.

Xiot commented 2 months ago

It appears that it due the length of the files array from payload.json.
I built the site, and removed all files, except for 1, and the page loaded up instantly.

I also noticed that the files array didn't include all of my files either. It only had 1200 files, and my repo has a lot more than that

antfu commented 2 months ago

Can you check if v0.4.4 improves it? Thanks

Xiot commented 2 months ago

That is much better. Thanks!