Commit fb4ae34
committed
🤖 fix: replace existsSync with async access() in ExtensionMetadataService
Replaced all sync fs operations (existsSync) with async alternatives using
fs/promises access(). This eliminates the last sync operations in the service.
Changes:
- Import access() and constants from fs/promises and fs
- Replace existsSync checks with try/catch on access()
- initialize(): Check directory existence with access() before mkdir
- load(): Check file existence with access() before readFile
Why ESLint didn't catch this:
- The 'local/no-sync-fs-methods' rule only catches fs.methodSync() usage
- Direct imports like 'import { existsSync } from "fs"' are not detected
- Rule needs enhancement to check ImportSpecifier nodes
Next steps:
- Enhance ESLint rule to catch direct imports of sync methods
- Or add src/utils/extensionMetadata.ts to allow list if sync is needed there1 parent 0a73310 commit fb4ae34
1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
0 commit comments