-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add type args and params (#48)
* feat: add type args and params * test: more coverage * fix: use default prettier formatting
- Loading branch information
Showing
8 changed files
with
1,210 additions
and
1,488 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
45 changes: 45 additions & 0 deletions
45
src/__tests__/__snapshots__/generic-tag.expected/auto.marko
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<my-tag<MyType, MyOtherType> my-attr="my-string"/> | ||
<my-tag <MyType, MyOtherType>|x|/> | ||
<my-tag <MyType>|x| my-attr="my-string"/> | ||
<my-tag<MyType>|x|/> | ||
<my-tag<MyType1><MyOtherType>|x|/> | ||
<my-tag< | ||
A, | ||
Whole, | ||
Bunch, | ||
Of, | ||
Tag, | ||
Attribute, | ||
Types, | ||
That, | ||
Need, | ||
To, | ||
Wrap, | ||
To, | ||
The, | ||
Next, | ||
Line | ||
>< | ||
A, | ||
Whole, | ||
Bunch, | ||
Of, | ||
Tag, | ||
Parameter, | ||
Types, | ||
That, | ||
Need, | ||
To, | ||
Wrap, | ||
To, | ||
The, | ||
Next, | ||
Line, | ||
>|x|/> | ||
<my-tag < | ||
T extends | ||
keyof (typeof SuperLongImportedVariableName)["member1"]["member2"]["member3"], | ||
K extends T extends string | ||
? MyType["member1"]["member2"]["member3"] | ||
: MyOtherType, | ||
>|x|/> |
45 changes: 45 additions & 0 deletions
45
src/__tests__/__snapshots__/generic-tag.expected/concise.marko
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
my-tag<MyType, MyOtherType> my-attr="my-string" | ||
my-tag <MyType, MyOtherType>|x| | ||
my-tag <MyType>|x| my-attr="my-string" | ||
my-tag<MyType>|x| | ||
my-tag<MyType1><MyOtherType>|x| | ||
my-tag< | ||
A, | ||
Whole, | ||
Bunch, | ||
Of, | ||
Tag, | ||
Attribute, | ||
Types, | ||
That, | ||
Need, | ||
To, | ||
Wrap, | ||
To, | ||
The, | ||
Next, | ||
Line | ||
>< | ||
A, | ||
Whole, | ||
Bunch, | ||
Of, | ||
Tag, | ||
Parameter, | ||
Types, | ||
That, | ||
Need, | ||
To, | ||
Wrap, | ||
To, | ||
The, | ||
Next, | ||
Line, | ||
>|x| | ||
my-tag < | ||
T extends | ||
keyof (typeof SuperLongImportedVariableName)["member1"]["member2"]["member3"], | ||
K extends T extends string | ||
? MyType["member1"]["member2"]["member3"] | ||
: MyOtherType, | ||
>|x| |
45 changes: 45 additions & 0 deletions
45
src/__tests__/__snapshots__/generic-tag.expected/html.marko
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<my-tag<MyType, MyOtherType> my-attr="my-string"/> | ||
<my-tag <MyType, MyOtherType>|x|/> | ||
<my-tag <MyType>|x| my-attr="my-string"/> | ||
<my-tag<MyType>|x|/> | ||
<my-tag<MyType1><MyOtherType>|x|/> | ||
<my-tag< | ||
A, | ||
Whole, | ||
Bunch, | ||
Of, | ||
Tag, | ||
Attribute, | ||
Types, | ||
That, | ||
Need, | ||
To, | ||
Wrap, | ||
To, | ||
The, | ||
Next, | ||
Line | ||
>< | ||
A, | ||
Whole, | ||
Bunch, | ||
Of, | ||
Tag, | ||
Parameter, | ||
Types, | ||
That, | ||
Need, | ||
To, | ||
Wrap, | ||
To, | ||
The, | ||
Next, | ||
Line, | ||
>|x|/> | ||
<my-tag < | ||
T extends | ||
keyof (typeof SuperLongImportedVariableName)["member1"]["member2"]["member3"], | ||
K extends T extends string | ||
? MyType["member1"]["member2"]["member3"] | ||
: MyOtherType, | ||
>|x|/> |
45 changes: 45 additions & 0 deletions
45
src/__tests__/__snapshots__/generic-tag.expected/with-parens.marko
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<my-tag<MyType, MyOtherType> my-attr="my-string"/> | ||
<my-tag <MyType, MyOtherType>|x|/> | ||
<my-tag <MyType>|x| my-attr="my-string"/> | ||
<my-tag<MyType>|x|/> | ||
<my-tag<MyType1><MyOtherType>|x|/> | ||
<my-tag< | ||
A, | ||
Whole, | ||
Bunch, | ||
Of, | ||
Tag, | ||
Attribute, | ||
Types, | ||
That, | ||
Need, | ||
To, | ||
Wrap, | ||
To, | ||
The, | ||
Next, | ||
Line | ||
>< | ||
A, | ||
Whole, | ||
Bunch, | ||
Of, | ||
Tag, | ||
Parameter, | ||
Types, | ||
That, | ||
Need, | ||
To, | ||
Wrap, | ||
To, | ||
The, | ||
Next, | ||
Line, | ||
>|x|/> | ||
<my-tag < | ||
T extends | ||
keyof (typeof SuperLongImportedVariableName)["member1"]["member2"]["member3"], | ||
K extends T extends string | ||
? MyType["member1"]["member2"]["member3"] | ||
: MyOtherType, | ||
>|x|/> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<my-tag<MyType, MyOtherType> my-attr="my-string" /> | ||
<my-tag <MyType, MyOtherType>|x| /> | ||
<my-tag | ||
<MyType>|x| | ||
my-attr="my-string" | ||
/> | ||
<my-tag<MyType>|x|/> | ||
<my-tag<MyType1><MyOtherType>|x| /> | ||
<my-tag<A, Whole, Bunch, Of, Tag, Attribute, Types, That, Need, To, Wrap, To, The, Next, Line> | ||
<A, Whole, Bunch, Of, Tag, Parameter, Types, That, Need, To, Wrap, To, The, Next, Line>|x| /> | ||
<my-tag <T extends keyof (typeof SuperLongImportedVariableName)["member1"]["member2"]["member3"], K extends (T extends string ? MyType["member1"]["member2"]["member3"] : MyOtherType)>|x| /> |
This file contains 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