Skip to content

prefer-at: ignore arguments[arguments.length - 1] #2662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BridgeAR opened this issue May 29, 2025 · 2 comments
Open

prefer-at: ignore arguments[arguments.length - 1] #2662

BridgeAR opened this issue May 29, 2025 · 2 comments

Comments

@BridgeAR
Copy link

Description

When using arguments throughout the code, it is sometimes not easy to change those to use the spread notation.

It would be great to have an option to deactivate any arguments detection for this rule.

Examples

// ❌ Without the options this is marked as error
const cb = arguments[arguments.length - 1]

// ✅ With { acceptArguments: true } option, this is not marked as error
const cb = arguments[arguments.length - 1]

Additional Info

No response

@github-actions github-actions bot changed the title rule-name: prefer-at rule-name: prefer-at May 29, 2025
@fisker
Copy link
Collaborator

fisker commented May 29, 2025

We can ignore arguments, no need an option.

@BridgeAR
Copy link
Author

That would also work and might be best, since the prefer-rest arguments would just have to be activated to get to an array and afterwards this rule would apply.

@fisker fisker changed the title rule-name: prefer-at prefer-at: ignore arguments[arguments.length - 1] Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants