You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When utilizing an IDE's autocomplete for overriding methods (Actor's onPreUpdate for example), it will autocomplete the method using param names from the definition of the super class:
Since the params are named with _ prefix in the super method, I get them in my autocomplete too. I then go and remove them manually, kind of ruining the benefits of the autocomplete.
Proposal
I presume this _ is to dodge the no-unused-vars eslint rule. Perhaps there's a better way to do this so that it doesn't affect the public API.
Suggestions:
Disable the no-unused-vars rule for the line of the overridable methods
classActor{onPreUpdate(engine,delta){// eslint-disable-line no-unused-vars }// or/** * Not sure if this affects the JS doc for the method **/// eslint-disable-next-line no-unused-vars onPreUpdate(engine,delta){}}
Customize the no-unused-vars rule to ignore based on some other pattern... perhaps hardcoding engine, delta, as those seem to be the most common... but this isn't very scalable
The text was updated successfully, but these errors were encountered:
@mattjennings I agree, this is very goofy looking. And you are 100% right, eslint is the reason. I'd be down to do disable by line on overrides for sure.
eonarheim
added
the
bug
This issue describes undesirable, incorrect, or unexpected behavior
label
Dec 26, 2023
Context
When utilizing an IDE's autocomplete for overriding methods (Actor's
onPreUpdate
for example), it will autocomplete the method using param names from the definition of the super class:Since the params are named with
_
prefix in the super method, I get them in my autocomplete too. I then go and remove them manually, kind of ruining the benefits of the autocomplete.Proposal
I presume this
_
is to dodge the no-unused-vars eslint rule. Perhaps there's a better way to do this so that it doesn't affect the public API.Suggestions:
engine
,delta
, as those seem to be the most common... but this isn't very scalableThe text was updated successfully, but these errors were encountered: