@@ -16,7 +16,7 @@ use biome_js_parser::{AnyJsRoot, JsFileSource, JsParserOptions};
1616use biome_js_type_info:: { TypeData , TypeResolver } ;
1717use biome_json_parser:: { JsonParserOptions , ParseDiagnostic } ;
1818use biome_module_graph:: ModuleGraph ;
19- use biome_package:: { PackageJson , TsConfigJson } ;
19+ use biome_package:: { Manifest , PackageJson , TsConfigJson } ;
2020use biome_project_layout:: ProjectLayout ;
2121use biome_rowan:: { Direction , Language , SyntaxKind , SyntaxNode , SyntaxSlot } ;
2222use biome_service:: file_handlers:: DocumentFileSource ;
@@ -212,14 +212,11 @@ pub fn project_layout_for_test_file(
212212 diagnostics : & mut Vec < String > ,
213213) -> Arc < ProjectLayout > {
214214 let project_layout = ProjectLayout :: default ( ) ;
215+ let fs = OsFileSystem :: new ( input_file. parent ( ) . unwrap ( ) . to_path_buf ( ) ) ;
215216
216217 let package_json_file = input_file. with_extension ( "package.json" ) ;
217218 if let Ok ( json) = std:: fs:: read_to_string ( & package_json_file) {
218- let deserialized = biome_deserialize:: json:: deserialize_from_json_str :: < PackageJson > (
219- json. as_str ( ) ,
220- JsonParserOptions :: default ( ) ,
221- "" ,
222- ) ;
219+ let deserialized = PackageJson :: read_manifest ( & fs, & package_json_file) ;
223220 if deserialized. has_errors ( ) {
224221 diagnostics. extend (
225222 deserialized
@@ -246,13 +243,7 @@ pub fn project_layout_for_test_file(
246243
247244 let tsconfig_file = input_file. with_extension ( "tsconfig.json" ) ;
248245 if let Ok ( json) = std:: fs:: read_to_string ( & tsconfig_file) {
249- let deserialized = biome_deserialize:: json:: deserialize_from_json_str :: < TsConfigJson > (
250- json. as_str ( ) ,
251- JsonParserOptions :: default ( )
252- . with_allow_comments ( )
253- . with_allow_trailing_commas ( ) ,
254- "" ,
255- ) ;
246+ let deserialized = TsConfigJson :: read_manifest ( & fs, & tsconfig_file) ;
256247 if deserialized. has_errors ( ) {
257248 diagnostics. extend (
258249 deserialized
0 commit comments