Conversation
@action binds transitionTo, replaceWith and open, but their types say method, so typescript-eslint's unbound-method reports {{on "click" link.open}}. TestLink's overrides take the same event type as Link's, which property types require.
Author
|
closing, needs some refac first i think |
Collaborator
|
Happy to accept it though :) Also hit me up on discord to move such thing forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
transitionTo,replaceWithandopenare bound by@action, but their types say "method". So typescript-eslint'sunbound-methodreports{{on "click" link.open}}when type-aware rules run on templates (emberjs/rfcs#1045 comment). As arrow functions, the types say they are bound.Possibly breaking at runtime:
Linkis exported as a class. A subclass outside this repo that overrides one of these as a method would now be ignored, because the arrow field on the instance shadows the prototype method.TestLinkoverrides them with arrow fields too, so it still works.TestLink's overrides now takeevent?: Event | unknown, likeLink's: property types are checked strictly, so the narrowerEventno longer fits. It prevents the default with the existingpreventDefaulthelper.Types, tests (46) and build pass.
lint:jsreports the same 6 errors intests/unit/test-helpers/link-for-test.tsasmain.Cowritten by Claude