Skip to content

Commit 8e77d65

Browse files
authored
fix(core): don't load manifests inside node_modules for now (#5857)
1 parent e4c9390 commit 8e77d65

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

crates/biome_js_analyze/src/lint/correctness/use_jsx_key_in_iterable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ declare_lint_rule! {
5151
/// "checkShorthandFragments": true
5252
/// }
5353
/// }
54-
/// ```
54+
/// ```
5555
/// ```jsx,expect_diagnostic,use_options
5656
/// data.map((x) => <>{x}</>);
5757
/// ```

crates/biome_service/src/workspace/scanner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl TraversalContext for ScanContext<'_> {
270270
if self.scan_kind.is_known_files() {
271271
(path.is_ignore() || path.is_config() || path.is_manifest()) && !path.is_dependency()
272272
} else if path.is_dependency() {
273-
path.is_manifest() || path.is_type_declaration()
273+
path.is_type_declaration()
274274
} else {
275275
DocumentFileSource::try_from_path(path).is_ok() || path.is_ignore()
276276
}

crates/biome_service/tests/spec_test.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,18 @@ fn test_scanner_only_loads_type_definitions_from_node_modules() {
5050
})
5151
.unwrap();
5252

53-
let manifest_result = workspace.get_file_content(GetFileContentParams {
54-
project_key,
55-
path: BiomePath::new(format!("{fixtures_path}/node_modules/shared/package.json")),
56-
});
57-
58-
assert!(
59-
manifest_result.is_ok_and(|result| !result.is_empty()),
60-
"package.json should be loaded"
61-
);
53+
// FIXME: We should load manifests again in order to actually resolve
54+
// type definitions, but last time we tried we ran into performance
55+
// issues, and a reoccurrence of panics inside `node_semver` (#5829).
56+
//let manifest_result = workspace.get_file_content(GetFileContentParams {
57+
// project_key,
58+
// path: BiomePath::new(format!("{fixtures_path}/node_modules/shared/package.json")),
59+
//});
60+
//
61+
//assert!(
62+
// manifest_result.is_ok_and(|result| !result.is_empty()),
63+
// "package.json should be loaded"
64+
//);
6265

6366
let d_mts_result = workspace.get_file_content(GetFileContentParams {
6467
project_key,

0 commit comments

Comments
 (0)