Files
eb8367e262 fix: skip unreadable tsconfig files during auto-discovery (#1033)
## Summary

- When `TsconfigDiscovery::Auto` walks parent directories and finds a
`tsconfig.json` that exists but cannot be read (e.g. permission denied
in sandboxed environments like Bazel/Docker), treat it as if no tsconfig
exists at that level and continue walking parent directories.
- Previously, `read_to_string` I/O failures were mapped to
`TsconfigNotFound`, conflating "file not found" with "file not
readable." Now I/O errors are properly mapped to `IOError`, and
`find_tsconfig_auto` catches `IOError` to skip unreadable files while
still propagating real config errors (bad JSON, broken extends, circular
references).

Context:
https://github.com/vitejs/vite/pull/21705#issuecomment-3957052097

## Test plan

- Added `tsconfig_discovery_skips_unreadable_file` test (unix-only) that
creates a `tsconfig.json` with `chmod 000` and verifies `find_tsconfig`
returns `Ok(None)`
- All existing tsconfig discovery tests continue to pass

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Boshen <[email protected]>

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-26 15:36:23 +08:00
..