-
Notifications
You must be signed in to change notification settings - Fork 183
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
Support props in ESLint-based rules #1100
Comments
class A {
static foo = 42; // fails with "Unexpected token = "
} class A {
foo = 42; // fails with "Unexpected token = "
}
Proposition https://github.com/tc39/proposal-class-fields |
Wouldn't this be as simple as always using |
@simonedavico good point, but are you sure there is no such syntax supported by espree and not supported by babel? |
Unfortunately I am not an expert in js/es parsers...for sure, I opened PR #1143 , would you be so kind to take a look and give some feedback? |
We're encountering the same issue in our project, and its halted usage on front-end analysis for us. |
I agree @simonedavico 's PR is all ok from the implementation point of view. If that solution is not feasible for some reason, would this be the case of making the Allowing for the parser to be a configurable aspect of Sonar JS could also open up the solution for greater configurability — https://eslint.org/docs/user-guide/configuring#specifying-parser |
@gersongoulart I actually wanted to make it configurable, but it would be more difficult to implement tests for each parser, since they are not feature equivalent. Of course with additional effort it could be achieved. |
It would be nice if SonarJS would be able to reuse the ESLint configuration regarding which parser to use (since SonarJS uses ESLint's Espree anyway, so there's obvious overlap) and which files to include or exclude. It would make using SonarJS more streamlined and avoid having to duplicate settings, on top of supporting proposed JS features. |
No description provided.
The text was updated successfully, but these errors were encountered: