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

Time-out issues after setting eslint rules #207

Open
sjaakbanaan opened this issue Jan 10, 2025 · 7 comments
Open

Time-out issues after setting eslint rules #207

sjaakbanaan opened this issue Jan 10, 2025 · 7 comments

Comments

@sjaakbanaan
Copy link

sjaakbanaan commented Jan 10, 2025

I tried installing this eslint plugin today:
"@pandacss/eslint-plugin": "^0.2.3",

I added the plugin like this in my eslint config:

"plugins": [
    ...
    "@pandacss"
  ],

And then as soon as i add rules and restart my ESLint server, i get:

 Error: Stopping the server timed out
    at /Users/username/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:98293
    at b.restart (/Users/username/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:271060)
 

And ESLint no longer works.

These are the rules i added:

    "@pandacss/no-config-function-in-source": "error",
    "@pandacss/no-debug": "error",
    "@pandacss/no-dynamic-styling": "error",
    "@pandacss/no-hardcoded-color": "error",
    "@pandacss/no-invalid-token-paths": "error",
    "@pandacss/no-invalid-nesting": "error",
    "@pandacss/no-property-renaming": "error",
    "@pandacss/no-unsafe-token-fn-usage": "error",

Any idea what's going on here? Thanks.

@gajus
Copy link

gajus commented Feb 3, 2025

This appears to be a major issue.

@anubra266 do you have a clue on what's the bottleneck?

@anubra266
Copy link
Collaborator

anubra266 commented Feb 3, 2025

This appears to be a major issue.

@anubra266 do you have a clue on what's the bottleneck?

@gajus I've not encountered this, but I'll see if I can reproduce later in the evening. Any more helpful errors from your editor logs would be helpful BTW

@gajus
Copy link

gajus commented Feb 3, 2025

Will spend some time debugging this today, but when I attempt to use this plugin in our project, ESLint goes entirely to a halt.

@gajus
Copy link

gajus commented Feb 7, 2025

Rule                               | Time (ms) | Relative
:----------------------------------|----------:|--------:
@pandacss/file-not-included        |  9434.809 |    14.8%
@pandacss/no-unsafe-token-fn-usage |  5100.427 |     8.0%
@pandacss/no-hardcoded-color       |  4944.562 |     7.7%
@pandacss/no-invalid-token-paths   |  4529.854 |     7.1%
@pandacss/no-dynamic-styling       |  4224.377 |     6.6%
@pandacss/no-property-renaming     |  3183.236 |     5.0%
prettier/prettier                  |  3147.218 |     4.9%

Just tried again. If you run eslint with TIMING=1, every single panda rule shows up with massive latency.

@gajus
Copy link

gajus commented Feb 7, 2025

I didn't validate this, but I am 80% sure that the reason for this is because the current implementation does not cache the results of:

const isFileIncluded = isValidFile(context)

and

isPandaImport(node, context)

@gajus
Copy link

gajus commented Feb 11, 2025

@anubra266 I will happily submit a PR if that's the blocker here.

@anubra266
Copy link
Collaborator

@gajus Feel free to open a PR

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