Skip to content

Comments

fix(linter): fix is_method_call with parentheses and chain expression#7095

Merged
Boshen merged 2 commits intooxc-project:mainfrom
tbashiyy:fix/is_method_call_with_parenthesized_and_chain_expression
Nov 4, 2024
Merged

fix(linter): fix is_method_call with parentheses and chain expression#7095
Boshen merged 2 commits intooxc-project:mainfrom
tbashiyy:fix/is_method_call_with_parenthesized_and_chain_expression

Conversation

@tbashiyy
Copy link
Contributor

@tbashiyy tbashiyy commented Nov 3, 2024

I fixed is_method_call behavior in specific case below.

For example, when we use is_method_call(call_expr, None, Some(&["apply"]), Some(1), Some(1)) for (a?.b.apply)(args), we cannot check correctly.

This is because we don't consider call_expr has parentheses and chain expression.

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 3, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Nov 3, 2024
@tbashiyy tbashiyy changed the title fix(linter): is_method_call with parentheses and chain expression fix(linter): fix is_method_call with parentheses and chain expression Nov 3, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 3, 2024

CodSpeed Performance Report

Merging #7095 will not alter performance

Comparing tbashiyy:fix/is_method_call_with_parenthesized_and_chain_expression (b6f735b) with main (9ed9501)

Summary

✅ 30 untouched benchmarks

Copy link
Member

@Boshen Boshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a supporting test case.

@tbashiyy tbashiyy force-pushed the fix/is_method_call_with_parenthesized_and_chain_expression branch from 7fabc7b to b6f735b Compare November 4, 2024 01:01
@tbashiyy
Copy link
Contributor Author

tbashiyy commented Nov 4, 2024

@Boshen
I added a simple test case using unicorn/prefer_array_flat. This test case is fail if current main branch.
(I cannot find unit tests for ast-util.rs, that's why I added test using lint rules.)

@tbashiyy tbashiyy requested a review from Boshen November 4, 2024 01:08
@Boshen Boshen merged commit b73cfd9 into oxc-project:main Nov 4, 2024
@oxc-bot oxc-bot mentioned this pull request Nov 9, 2024
Boshen added a commit that referenced this pull request Nov 9, 2024
## [0.11.1] - 2024-11-09

### Features

- 4dd9b60 editor/vscode: Replace existing output channel and trace
output channel with a single LogOutputChannel (#7196) (Nicholas Rayburn)
- 1fcd709 linter: Add jsx support for only-used-in-recursion (#7120)
(no-yan)
- 4d577cf linter: Add `import/first` rule (#7180) (Dmitry Zakharov)
- 9b8973f linter: Add `import/unambiguous` rule (#7187) (Dmitry
Zakharov)
- 5ab1ff6 linter: Implement @typescript-eslint/no-unsafe-function-type
(#6989) (Orenbek)

### Bug Fixes

- eea8879 editor/vscode: Update language client id to fix the resolution
of the oxc.trace.server setting (#7181) (Nicholas Rayburn)
- b73cfd9 linter: Fix `is_method_call` with parentheses and chain
expression (#7095) (tbashiyy)

### Refactor

- 8c0a362 linter: Use `ctx.source_range(comment.content_span())` API
(#7155) (Boshen)
- c5485ae semantic: Add `ancestor_kinds` iterator function (#7217)
(camchenry)
- abf1602 semantic: Rename `iter_parents` to `ancestors` (#7216)
(camchenry)
- 42171eb semantic: Rename `ancestors` to `ancestor_ids` (#7215)
(camchenry)

Co-authored-by: Boshen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants