perf(eslint): cache package.json read in AMD module import rule
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
- **VS Code Version:** Main branch (Dev)
- **OS Version:** N/A
### Problem Description
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!
Contributor guide
Assessment
This issue has not been assessed yet.