Conflicts between `no-prototype-builtins` and `no-useless-call`
See original GitHub issueTell us about your environment
- ESLint Version: 7.27.0
- Node Version: 16
- npm Version: 6
- Operating System: windows
What parser (default, @babel/eslint-parser
, @typescript-eslint/parser
, etc.) are you using?
default(espree)
Please show your full configuration:
Configuration
// I don't think this is useful
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
I want check a property is Object’s own property,
Object.prototype.hasOwnProperty(property);
no-prototype-builtins
reports an error.
Object.prototype.hasOwnProperty.call(Object.prototype, property);
no-useless-call
reports an error.
What did you expect to happen?
no-useless-call
rule should ignore Object.prototype.hasOwnProperty.call(Object.prototype, ...)
What actually happened? Please copy-paste the actual, raw output from ESLint.
N/A
Steps to reproduce this issue:
N/A
Are you willing to submit a pull request to fix this bug?
No
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
no-prototype-builtins - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >eslint-module-utils 2.5.1 broken · Issue #1604 - GitHub
Hey, when using eslint-module-utils 2.5.1, my eslint stops being able to resolve most imports. I receive lots of errors of this type: 1:1 ......
Read more >Fixing 'The body of a for-in should be wrapped in an if ...
Fixing 'The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype' · 1. Never...
Read more >List of available rules - ESLint - Pluggable JavaScript linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >@cling/eslint-config - npm
These rules relate to better ways of doing things to help you avoid problems: disallow lexical declarations in case clauses ( no-case-declarations );...
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 FreeTop 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
Top GitHub Comments
Yeah, I also agree that this is more of an edge case and I can’t see a generic way to solve the conflict that doesn’t cause other problems. When there are as many core rules as ESLint has, it just gets difficult to make them all play together in every configuration.
I updated expect to
no-useless-call
rule should ignoreObject.prototype.hasOwnProperty.call(Object.prototype, ...)