prefer-rest-params warns when using arguments.callee.name
See original GitHub issueWhat version of ESLint are you using? 2
What parser (default, Babel-ESLint, etc.) are you using? babel
Please show your full configuration: It’s really long.
What did you do? Please include the actual source code causing the issue. I wrote the code:
export default function freeMemory () {
return this.store.hset(arguments.callee.name, new Date(), os.freeMemory())
}
What did you expect to happen?
Nothing.
What actually happened? Please include the actual, raw output from ESLint.
I got a linter error from prefer-rest-params
, because I was using arguments. I don’t believe there’s a way to write what I did without calling arguments.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
arguments.callee - JavaScript - MDN Web Docs
This is useful when the name of the function is unknown, such as within a function expression with no name (also called "anonymous...
Read more >False positive in prefer-rest-params when checking arguments ...
I get this warning: Use the rest parameters instead of 'arguments' prefer-rest-params. I believe this to be a false positive.
Read more >Arguments.callee is deprecated - what should be used instead?
Avoid using arguments.callee() by either giving function expressions a name or use a function declaration where a function must call itself.
Read more >Disallow Use of caller/callee (no-caller) - ESLint
This rule is aimed at discouraging the use of deprecated and sub-optimal code by disallowing the use of arguments.caller and arguments.callee . As...
Read more >ReferenceError: deprecated caller or arguments usage
TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context (Edge) Warning: ReferenceError: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, this is very similar to #5990. I will make the rule ignoring
arguments
if it’s to access the properties except numbers. So, #5990 would fix this issue as well.@mysticatea thanks for the update! In that case, I think we can indeed close this issue in favor of #5990.
@krainboltgreene please follow #5990 for updates on the fix. Thanks for the report and your support!
Closing this, please re-open if anyone disagrees.