-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
feat(linter): Implement no_this_before_super with cfg #2254
feat(linter): Implement no_this_before_super with cfg #2254
Conversation
CodSpeed Performance ReportMerging #2254 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the error span biome and eslint emits, and combining with the general advice on error spans https://oxc-project.github.io/docs/contribute/linter.html#general-advice
Pin point the error message to the shortest code span
We want the user to focus on the problematic code rather than deciphering the error message to identify which part of the code is erroneous.
The best span would be 1 span pointing to the constructor
keyword, and the other error span pointing to the this
keyword.
1 │ class A extends B { constructor() { this.c = 0; } }
· ___________ ____
The second best is to point to the whole method
1 │ class A extends B { constructor() { this.c = 0; } }
· _____________________________
e327bff
to
564873c
Compare
✅ Deploy Preview for oxc canceled.
|
Do we have a mechanism for this? My concern is that, say there are 2 uses of |
Here's an example for multiple spans: oxc/crates/oxc_linter/src/rules/eslint/no_sparse_arrays.rs Lines 58 to 63 in 0c225a4
Feel free to to pick either one depending on your time availableness. |
564873c
to
fab10a0
Compare
I'm going to submit with the option highlighting the whole method for now and open an issue to make it better. I'd like to explore a bit more what the right approach would be; I have a few ideas. |
fab10a0
to
366452d
Compare
Opened #2290 |
Implements `eslint/no-this-before-super` in oxc-project#479. Closes oxc-project#2279
Implements
eslint/no-this-before-super
in #479.Closes #2279