Conversation
crates/oxc_linter/src/rules/unicorn/no_invalid_fetch_options.rs
Outdated
Show resolved
Hide resolved
crates/oxc_linter/src/rules/unicorn/no_invalid_fetch_options.rs
Outdated
Show resolved
Hide resolved
CodSpeed Performance ReportMerging #16687 will not alter performanceComparing Summary
Footnotes
|
crates/oxc_linter/src/rules/unicorn/no_invalid_fetch_options.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR fixes a false positive in the no-invalid-fetch-options rule where member expressions (e.g., options.method) were incorrectly being treated as GET or HEAD methods, triggering spurious errors when body was present. The fix ensures that when the method is accessed via a member expression from a non-enum object, it is treated as unknown and no error is reported.
Key changes:
- Added logic to set
method_nametoUNKNOWNwhen encountering non-identifier objects inStaticMemberExpression(e.g.,getOptions().method) - Added
elsebranch to handle non-enum identifier objects inStaticMemberExpression, settingmethod_nametoUNKNOWN - Comprehensive test coverage for various member expression scenarios including regular objects, function calls, and parenthesized expressions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot run cargo clippy and fix the failures |
Ran |
Co-authored-by: camc314 <[email protected]>
Signed-off-by: Cameron <[email protected]>
Signed-off-by: Cameron <[email protected]>
Co-authored-by: camc314 <[email protected]>
Signed-off-by: Cameron <[email protected]>
97a7960 to
9b621b9
Compare
…ession as method (#16687) - Fixes #16686 --------- Signed-off-by: Cameron <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: camc314 <[email protected]> Co-authored-by: Cameron <[email protected]>
…ession as method (oxc-project#16687) - Fixes oxc-project#16686 --------- Signed-off-by: Cameron <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: camc314 <[email protected]> Co-authored-by: Cameron <[email protected]>
options.method)getOptions().method,(options).method)Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.