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

Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@julien-f
Copy link

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?

@julien-f julien-f added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Oct 15, 2019
@mdjermanovic
Copy link
Member

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 There is consensus among the team that this change meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Oct 15, 2019
@mysticatea
Copy link
Member

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
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Apr 23, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.