question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support Class Fields

See original GitHub issue

The version of ESLint you are using. latest

The problem you want to solve. support class fields officially, as it has reached stage-4. refs: https://github.com/tc39/proposals/blob/master/finished-proposals.md

Your take on the correct solution to problem.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:25
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
minimitcommented, Oct 21, 2021
Class foo {
  #x
}

still yields error Parsing error: Unexpected character '#' on eslint 8.0.1 - Did I miss something?

Be sure to have this setting in .eslintjs.rc.

parserOptions: {
    ecmaVersion: 13,
3reactions
rhinonancommented, Apr 21, 2021

indent ?

Class Foo {
  private foo1 = 1
    private foo2 = 2 // eslint indent rule not given any errors
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

"class fields" | Can I use... Support tables for HTML5, CSS3, etc
Method of setting required fields and field types without requiring JavaScript. This includes preventing forms from being submitted when appropriate, ...
Read more >
Public class fields - JavaScript - MDN Web Docs - Mozilla
Public instance fields exist on every created instance of a class. By declaring a public field, you can ensure the field is always...
Read more >
Public and private class fields - V8 JavaScript engine
This article explains the new public class fields syntax in V8 v7.2 and Chrome 72, as well as the upcoming private class fields...
Read more >
JavaScript's New Private Class Fields, and How to Use Them
Class fields (also referred to as class properties) aim to deliver simpler constructors with private and static members. The proposal is ...
Read more >
JavaScript's new #private class fields – @thejameskyle
Public fields in JavaScript can be referenced via this.field or this['field'] . Private fields won't be able to support the second syntax (because...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found