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 '#' #1542

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

Parsing error: Unexpected character '#' #1542

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

Comments

@limpid-kzonix
Copy link

What version of this package are you using?

standard -> `14.3.4`
eslint-config-prettier-standard -> `3.0.1`
eslint-config-standard -> `14.1.1`

What problem do you want to solve?
Parsing error: Unexpected character '#'

export class Example {
  #privateVar;
  // ...
}

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

@NemoStein
Copy link

Standard only supports features in Stage 4 and up.
Class field declarations (https://github.com/tc39/proposal-class-fields) are still in stage 3.
TC39 Process: https://tc39.es/process-document/

@feross
Copy link
Member

feross commented Oct 22, 2020

Yep, what @NemoStein said. You'll need to use babel-eslint. Instructions are here: https://standardjs.com/#how-do-i-use-experimental-javascript-es-next-features

@feross feross closed this as completed Oct 22, 2020
@ghost
Copy link

ghost commented Jun 7, 2021

Is there any way to stop Standard from notifying me about the error? I have tried writing // eslint-disable-next-line on the line before the line in error. I have also tried writing // eslint-disable-line at the end of the erroring line. Neither worked.

@NemoStein
Copy link

NemoStein commented Jun 8, 2021

Class Fields moved to Stage 4 in April and ESLint is already tracking the change (eslint/eslint#14343).
The feature is expected to land in ESLint in a near future.
Standard (usually) follows shortly after.

Is there any way to stop Standard from notifying me about the error?

Someone may correct me if wrong, but I don't think so.
It's a syntax error, so it breaks the interpreter.
Or, as @feross noted, use another interpreter (e.g.: babel-eslint)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants