eslint-plugin-unicorn icon indicating copy to clipboard operation
eslint-plugin-unicorn copied to clipboard

`prefer-at`: ignore `arguments[arguments.length - 1]`

Open BridgeAR opened this issue 6 months ago • 2 comments

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

BridgeAR avatar May 29 '25 14:05 BridgeAR

We can ignore arguments, no need an option.

fisker avatar May 29 '25 15:05 fisker

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.

BridgeAR avatar May 29 '25 16:05 BridgeAR