Skip to content

Commit 7faaf8e

Browse files
committed
fix(linter/no-invalid-fetch-options): ignore non static method
1 parent 7c42ea0 commit 7faaf8e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/oxc_linter/src/rules/unicorn/no_invalid_fetch_options.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ fn is_invalid_fetch_options<'a>(
167167
let reference_id = value_ident.reference_id();
168168

169169
let Some(symbol_id) = symbols.get_reference(reference_id).symbol_id() else {
170+
method_name = UNKNOWN_METHOD_NAME;
170171
continue;
171172
};
172173

@@ -294,6 +295,7 @@ fn test() {
294295
method: Method.Post,
295296
body: "",
296297
});"#,
298+
("const response = await fetch('', { method, headers, body, });"),
297299
];
298300

299301
let fail = vec![

0 commit comments

Comments
 (0)