Skip to content

Commit 8aae3bc

Browse files
feat(biome_js_analyze): extracts class member references in a service
1 parent d57d26a commit 8aae3bc

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

crates/biome_js_analyze/tests/quick_test.rs

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,18 @@ fn project_layout_with_top_level_dependencies(dependencies: Dependencies) -> Arc
2525
}
2626

2727
// use this test check if your snippet produces the diagnostics you wish, without using a snapshot
28-
// #[ignore]
28+
#[ignore]
2929
#[test]
3030
fn quick_test() {
3131
const FILENAME: &str = "dummyFile.ts";
32-
const SOURCE: &str = r#"class TSDoubleUnusedPrivateConstructor {
33-
constructor(
34-
private usedOne: number,
35-
private usedTwo: string
36-
) {
37-
38-
// This constructor has two unused private properties
39-
}
40-
41-
method() {
42-
this.usedOne = usedOne + 'foo';
43-
console.warn(usedTwo);
44-
}
45-
}
32+
const SOURCE: &str = r#"import * as postcssModules from "postcss-modules"
33+
34+
type PostcssOptions = Parameters<postcssModules>[0]
4635
47-
class TSPartiallyUsedPrivateConstructor {
48-
constructor(private param: number) {
49-
foo(param)
50-
}
51-
}"#;
36+
export function f(options: PostcssOptions) {
37+
console.log(options)
38+
}
39+
"#;
5240

5341
let parsed = parse(SOURCE, JsFileSource::tsx(), JsParserOptions::default());
5442

@@ -64,7 +52,7 @@ class TSPartiallyUsedPrivateConstructor {
6452
.with_configuration(
6553
AnalyzerConfiguration::default().with_jsx_runtime(JsxRuntime::ReactClassic),
6654
);
67-
let rule_filter = RuleFilter::Rule("style", "useReadonlyClassProperties");
55+
let rule_filter = RuleFilter::Rule("correctness", "noUnusedImports");
6856

6957
let dependencies = Dependencies(Box::new([("buffer".into(), "latest".into())]));
7058

0 commit comments

Comments
 (0)