Commit c73225e
feat(linter/eslint): implement
this PR implements `eslint/prefer-arrow-callback` rule, passes all
upstream tests (39 pass + 68 fail cases, 51 autofix snapshots).
Highlights:
- Honors `allowNamedFunctions` and `allowUnboundThis` options (defaults
match ESLint).
- Strips `.bind(this)` chains during autofix and re-wraps the arrow in
parens when needed (member access, logical/binary operands).
- Handles optional chaining (`function?.bind(this)`, `foo?.(...)`) and
parenthesized callbacks.
issue #479
**AI Disclosure**: I used AI (Claude) to help with Rust idioms and oxc
internals. All output was reviewed locally; `cargo test -p oxc_linter`,
`cargo clippy -p oxc_linter --no-deps`, and `cargo fmt --check` are
clean.
---------
Co-authored-by: Cam McHenry <camchenry@users.noreply.github.com>prefer-arrow-callback rule (#22312)1 parent 3c53a95 commit c73225e
8 files changed
Lines changed: 1088 additions & 2 deletions
File tree
- apps/oxlint/src-js/package
- crates/oxc_linter/src
- generated
- rules/eslint
- snapshots
- npm/oxlint
- tasks/website_linter/src/snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| 869 | + | |
869 | 870 | | |
870 | 871 | | |
871 | 872 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
| |||
0 commit comments