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
{{ message }}
Repository navigation
perf(eslint): cache package.json read in AMD module import rule #334810
In the ESLint rule responsible for checking AMD module imports (vscode-eslint-plugin-local), readFileSync and JSON.parse are executed inside the create(context) method.
Because create(context) runs for every evaluated file during linting, package.json is repeatedly read from the file system and parsed into memory hundreds or thousands of times.
Proposed Solution / Steps
Move package.json reading logic outside of the create() method (to module scope) so it only runs once per linting session, eliminating unnecessary disk I/O.
I have a fix ready and would be happy to submit a PR for this!
Verified by linting two virtual files in one ESLint process and confirming package.json was read only once while the rule still reported both violations.
Activity
bhavyaus commentedon Sep 28, 2026
Verified by linting two virtual files in one ESLint process and confirming package.json was read only once while the rule still reported both violations.