Skip to content
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

False positive with no-obj-calls #12437

Closed
julien-f opened this issue Oct 15, 2019 · 2 comments · May be fixed by rubarb666/rails#3, rubarb666/git-sketch-plugin#2, O330oei/node#4 or O330oei/node#11
Closed

False positive with no-obj-calls #12437

julien-f opened this issue Oct 15, 2019 · 2 comments · May be fixed by rubarb666/rails#3, rubarb666/git-sketch-plugin#2, O330oei/node#4 or O330oei/node#11

Comments

@julien-f
Copy link

@julien-f julien-f commented Oct 15, 2019

Tell us about your environment

Environment Info:

Node version: v8.16.1
npm version: v6.11.3
Local ESLint version: v6.5.1 (Currently used)
Global ESLint version: Not found

What parser (default, Babel-ESLint, etc.) are you using?

default

Please show your full configuration:

Configuration
module.exports = {
  env: { es6: true },
  rules: { "no-obj-calls": "error" }
};

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

var construct = typeof Reflect !== "undefined" ? Reflect.construct : undefined;
construct();
eslint index.js

What did you expect to happen?

Should produce no error because I'm not calling Reflect.

What actually happened? Please include the actual, raw output from ESLint.

/index.js
  2:1  error  'construct' is not a function  no-obj-calls

✖ 1 problem (1 error, 0 warnings)

Are you willing to submit a pull request to fix this bug?

@mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Oct 15, 2019

Hi @julien-f , thanks for the report!

Confirmed, and there are other false positives: Online Demo Link

@mysticatea could this be a problem in eslint-utils, or maybe the rule doesn't use ReferenceTracker well?

@mdjermanovic mdjermanovic added accepted rule and removed triage labels Oct 15, 2019
@mysticatea
Copy link
Member

@mysticatea mysticatea commented Oct 16, 2019

This seems to be a bug in eslint-utils package. I guess the problem is in src/reference-tracker.js#L229-L232.

josgraha added a commit to josgraha/eslint that referenced this issue Oct 17, 2019
@mysticatea mysticatea self-assigned this Oct 20, 2019
mysticatea added a commit to mysticatea/eslint-utils that referenced this issue Oct 20, 2019
mysticatea added a commit that referenced this issue Oct 20, 2019
kaicataldo added a commit that referenced this issue Oct 24, 2019
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.