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 error on static property #3631

Closed
erosman opened this issue Nov 3, 2022 · 1 comment
Closed

False error on static property #3631

erosman opened this issue Nov 3, 2022 · 1 comment

Comments

@erosman
Copy link

erosman commented Nov 3, 2022

JSHint 2.13.5
esversion: 11

JSHint appears to report a false error on static properties.

Class properties must be methods. Expected '(' but instead saw '='.

Code Example: YouTubePatchCollection.user.js
Code snippet

class YTP {
  static observer = new MutationObserver(this.onNewScript);

  static _config = {};

  static isObject(item) {
      return (item && typeof item === "object" && !Array.isArray(item));
  }
...
@jugglinmike
Copy link
Member

Thanks for taking the time to write a report! The JavaScript language feature you are looking for is called "class fields," and it has not yet been implemented in JSHint. We already have an issue to track that feature at gh-3139, so I'm going to keep the discussion focused there and close this issue.

@jugglinmike jugglinmike closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants