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

Parsing error: Unexpected character '#' #13589

Closed
limpid-kzonix opened this issue Aug 18, 2020 · 2 comments
Closed

Parsing error: Unexpected character '#' #13589

limpid-kzonix opened this issue Aug 18, 2020 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion experimental syntax This change is related to experimental syntax (stage 3 or below)

Comments

@limpid-kzonix
Copy link

Please describe what the rule should do:
Support Private class fields

What new ECMAScript feature does this rule relate to?
Private class fields

What category of rule is this? (place an "X" next to just one item)

[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ X ] Other (Don't complain about private class fields with error: ESLint: Parsing error: Unexpected character '#')

Provide 2-3 code examples that this rule will warn about:

export class Example {
  #privateClassField

  constructor() {
    this.#privateClassField = ...
  }
 

Why should this rule be included in ESLint (instead of a plugin)?
This feature already supported in LTS version of node.
image

Are you willing to submit a pull request to implement this rule?
No

@limpid-kzonix limpid-kzonix added feature This change adds a new feature to ESLint rule Relates to ESLint's core rules triage An ESLint team member will look at this issue soon labels Aug 18, 2020
@mdjermanovic mdjermanovic added experimental syntax This change is related to experimental syntax (stage 3 or below) and removed feature This change adds a new feature to ESLint rule Relates to ESLint's core rules triage An ESLint team member will look at this issue soon labels Aug 18, 2020
@mdjermanovic
Copy link
Member

Hi @limpid-kzonix, thanks for the issue!

The class fields proposal is currently in stage 3.

Per our policy about experimental features, ESLint's default parser will support this syntax if and when it reaches stage 4.

In the meantime, you can use ESLint with an external parser, like @babel/eslint-parser which already supports this syntax.

@limpid-kzonix
Copy link
Author

Hi @mdjermanovic, Thanks for pointing me to the solutions.

I ran into a little babel-parser issue. And to be exact, the issue with eslint/lib/rules/no-unused-vars, only in case of using babel-parser.

I have prepared a minor fix for that one. But I'm worried the problem could be more in babel parser rather than eslint rule itself.

Could you please check the PR, I have attached a little description of the error there
#13592

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 16, 2021
@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 Feb 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion experimental syntax This change is related to experimental syntax (stage 3 or below)
Projects
None yet
Development

No branches or pull requests

2 participants