You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please make sure the graphql-eslint version under package.json matches yours.
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Describe the bug
Whenever a change is made to a file in vscode, the graphql config is reloaded which means loading possibly thousands of files, which in my case means it takes ~30sec for linting to update in my IDE.
My solution was to remove the documents part of the parserOptions and any rules that depended on it.
To Reproduce Steps to reproduce the behavior:
There is a setting to run the eslint server in vscode in debug mode. Turn that on:
"eslint.debug": true,
Open the eslint Output console: ESLint: Show Ouput Console
In a large codebase with lots of document definitions (sorry I can't provide mine), mostly nested inside ts/tsx files, the linter will take a while to load (which is ok)
When a change is made to a file, eslint takes a long time to show with the bottleneck being the config loading
A binary search shows that this problem was introduced between 3.12.0 and 3.13.0. Going by the changelog, the only change was #1222
Also, in my case the problem can be fixed similarly to #1246 (comment)
Whether in the eslint config or in the graphqlconfig, this problem is triggered by the documents configuration value being an array, as opposed to a string/glob.
e.g. instead of
documents: [
"queries.ts",
"queries.graphql",
]
use
documents: "queries.(ts|graphql)"
Apparently this prevents unnecessary busting of some cache.
@hedgepigdaniel tried both 3.12.0 and latest 3.20.1, same performance issue.
I don't use graphql-config so the operations: "./src/**/*.{ts,tsx}" is what causes slowness for me. I guess it tries to extract graphql documents from lot of files which causes the slowness.
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Describe the bug
Whenever a change is made to a file in vscode, the graphql config is reloaded which means loading possibly thousands of files, which in my case means it takes ~30sec for linting to update in my IDE.
My solution was to remove the
documents
part of the parserOptions and any rules that depended on it.To Reproduce Steps to reproduce the behavior:
There is a setting to run the eslint server in vscode in debug mode. Turn that on:
Open the eslint Output console:
ESLint: Show Ouput Console
In a large codebase with lots of document definitions (sorry I can't provide mine), mostly nested inside ts/tsx files, the linter will take a while to load (which is ok)
When a change is made to a file, eslint takes a long time to show with the bottleneck being the config loading
Logs:
Expected behavior
Changes to individual documents shouldn't cause an entire reload
Environment:
@graphql-eslint/eslint-plugin
: 3.20.1The text was updated successfully, but these errors were encountered: