-
Notifications
You must be signed in to change notification settings - Fork 507
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
ObjectTypeLiteral support #415
Conversation
da71a89
to
d84d72f
Compare
I see that this is still marked as "Draft" Do you want to remove that @WoH or are you still waiting for more feedback from other members or something? |
I'm a little confused (probably due to severe lack of sleep) so sorry if this is a stupid question, but what kind of 'objects' can we use know? Is it an implementation of #353? |
Mostly I'm dreading the tests I'll want to write around this. This PR should already cover nested JSDoc annotations and pretty much everything we support on interface declarations. However, that means we want to make sure it does and will not regress at any point in the future.
No. The primary concern of this PR are type definitions wrapped inside interface Model {
prop: {
nested: string
}
} or function(): { value: number } {
...
} |
Wait how is that different from my implementation of #353 (supporting |
Ok, so a What I'm doing is adding a way to resolve |
Oh wait I think I get it, you're adding support for an "anonymous" object, just not in As a side note, I might post a very work-in-progress PR with my implementation of |
I'll open this one up, got some (admittedly lazy) JSDoc validation specs in. |
Anticipating some of @dgreene1's review in f3d9fb0 and 55f9ca7 to reduce the time he has to invest in PR review (hopefully). I tried to improve UX for validations, throw if metadata is missing, added an assertion that a nested object value is an object in the first place. Got around to spec excess prop handling (ignore, remove, throw), see 55f9ca7 Happy to get reviews at this point. |
@@ -333,12 +422,6 @@ export class TestClassModel extends TestClassBaseModel { | |||
stringProperty: string; | |||
protected protectedStringProperty: string; | |||
|
|||
public static typeLiterals = { |
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 removed these since they were messing up type resolution (Boolean, Number and String
will throw) now that we actually examine the content of the Block.
E: They were not actually used in tests anyway.
Rebased for the green checkmark. |
3fe932a
to
d9a9367
Compare
@dgreene1 I just rebased and realized checks are not running anymore. Is this intended? |
I’m hoping this solves #415 (comment)
I don’t know what’s up with github actions. I just made a change that should hopefully force the tests to be run on each commit. |
- Assert nOL is object - Throw on missing nested properties - Print excess prop value
PSA: f8eef44#diff-d107cbd1a26a9e3dbdf1db48ecdeac37R1 was apparently not subjected to the prettier hook, I had to do some trickery to get the automatic fix out of this PR, but I can append it if it's wanted, I did not, in order to avoid merge conflicts and keep this PR clean. |
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.
Really fantastic job on this PR. I think those two places that were lacking intersection tests are the only places that I think are lacking coverage.
Currently open issue: #50
R4R