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

`no-undef` false positive #5420

Closed
mysticatea opened this Issue Feb 27, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@mysticatea
Member

mysticatea commented Feb 27, 2016

From https://twitter.com/ymyzk/status/703426419481661440 (Japanese)

no-undef is warning new.target meta property.

> eslint -v
v2.2.0
> echo "class A { constructor() { new.target; } }" | eslint --stdin --env es6 --rule no-undef:2 --no-eslintrc

<text>
  1:27  error  'new' is not defined     no-undef
  1:31  error  'target' is not defined  no-undef

✖ 2 problems (2 errors, 0 warnings)

This seems to be a bug of escope.
escope has been creating references of new and target identifiers.
I will try to fix this.

@rozzzly

This comment has been minimized.

Show comment
Hide comment
@rozzzly

rozzzly Feb 29, 2016

Im also getting it on const derp = Symbol();

rozzzly commented Feb 29, 2016

Im also getting it on const derp = Symbol();

@mysticatea

This comment has been minimized.

Show comment
Hide comment
@mysticatea

mysticatea Feb 29, 2016

Member

@rozzzly Can you open a new issue? This issue is about new.target meta property.

Member

mysticatea commented Feb 29, 2016

@rozzzly Can you open a new issue? This issue is about new.target meta property.

@rozzzly

This comment has been minimized.

Show comment
Hide comment
@rozzzly

rozzzly Feb 29, 2016

Well I found that I just had to edit:

.eslintrc
  // ...
  "env": {
    "es6": true,
    "browser": true,
    "node": true
  },
  // ...

Unrelated, but the same error.

rozzzly commented Feb 29, 2016

Well I found that I just had to edit:

.eslintrc
  // ...
  "env": {
    "es6": true,
    "browser": true,
    "node": true
  },
  // ...

Unrelated, but the same error.

@mysticatea mysticatea removed the blocked label Feb 29, 2016

mysticatea added a commit to mysticatea/eslint that referenced this issue Mar 1, 2016

ilyavolodin added a commit that referenced this issue Mar 1, 2016

Merge pull request #5440 from mysticatea/no-undef/fix-new-target
Fix: `no-undef` false positive at new.target (fixes #5420)

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.