-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed as not planned
Labels
archived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyrepro:neededThis issue should include a reproducible exampleThis issue should include a reproducible example
Description
Environment
Node version: v16.17.0
npm version: v8.18.0
Local ESLint version: v8.23.0 (Currently used)
Global ESLint version: v8.23.0
Operating System: linux 5.4.0-1089-azure
What parser are you using?
Default (Espree)
What did you do?
Configuration
{
"env": {
"browser": true,
"jquery": true,
"es6": true,
"es2020": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": "latest"
},
"extends": "eslint:recommended",
"rules": {
"prefer-reflect": "error"
}
}
Code:
function getOwnPropertyNamesLength(obj) {
return Object.getOwnPropertyNames(obj).length;
}
What did you expect to happen?
Due to the function Reflect.getOwnPropertyNames
still doesn't exist (I can't even find it in caniuse.com), the rule prefer-reflect
should not consider about it, so does the document.
What actually happened?
The rule complain that "Avoid using Object.getOwnPropertyNames, instead use Reflect.getOwnPropertyNames."
Participation
- I am willing to submit a pull request for this issue.
Additional comments
I knew that #7075 is about it and closed, but I met the problem again, that's why I submit this issue.
Metadata
Metadata
Assignees
Labels
archived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyrepro:neededThis issue should include a reproducible exampleThis issue should include a reproducible example
Type
Projects
Status
Complete