Skip to content

no-undef false positive on class properties/fields. #8720

@jsg2021

Description

@jsg2021

Tell us about your environment

  • ESLint Version: 4.0.0
  • Node Version: 8.0.0
  • npm Version: 5.0.3

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

Please show your full configuration:

{
	"extends": "eslint:recommended",
	"parserOptions": {
		"ecmaVersion": 2017,
		"sourceType": "module",
		"ecmaFeatures": {
			"experimentalObjectRestSpread": true,
			"impliedStrict": true,
			"globalReturn": false,
			"jsx": true
		}
	},
	"parser": "babel-eslint"
}

What did you do? Please include the actual source code causing the issue.

class Foo {
    static bar = true

    baz = 'meh'
}

What did you expect to happen?
no errors.

What actually happened? Please include the actual, raw output from ESLint.
no-undef is treating bar and baz as errors (assigning new globals?) This didn't error in eslint 3.x.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    archived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionruleRelates to ESLint's core rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy