-
Notifications
You must be signed in to change notification settings - Fork 35
Fix some param reassignments, and enable lint. #72
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
Conversation
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.
This is great! Such a great idea to do this. Every file except ecmascript.ts should be fair game for this change, and I'll plan to do the same for ecmascript.ts.
Do you think we should make the same change to the proposal-temporal code to keep them in sync? Or best to make it only here? @ptomato do you have an opinion?
I think an advantage of porting this to proposal-temporal would be reduced divergence for porting future changes from proposal-temporal to here, but on the other hand it would increase the divergence between the proposal-temporal code and the specification. So I feel neutral-to-negative about that. |
(Not a Temporal Champion but) I'm in agreement with Philip here - the spec isn't written this way (though, frankly that seems a bit odd to me too, though I suppose for JS itself it doesn't really care about reassignment in the way that developers do for e.g. readability of the code), but given that it is I think it makes sense to leave the proposal repo as-is. |
395e826
to
0ecdc3f
Compare
0ecdc3f
to
e53546a
Compare
Ok - I've fixed up the rest of the files besides ecmascript, and adopted the pattern that Justin suggested (which lead to some much nicer diffs!). PTAL. |
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.
Looks great. This PR will make adding types to parameters much easier. Let's go ahead and merge this ASAP when you're ready, and I'll rebase the ecmascript changes on top.
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 probably won't have time to review this in detail but spot-checking looks good.
@justingrant sounds great. I've just "finished" (tests all pass) integrating JSBI into Temporal (see #77), and I want to rebase that ontop of your ecmascript changes and have fixed the lint suppression for ecmascript.ts before I send that for review. |
Finishing what js-temporal#72 started. Previous commits avoided mutation of params only where the types changed. This commit adds eslint support for preventing param mutation and makes changes that don't change the underlying type. I split into a separate commit in case we want to make this a new PR.
Finishing what js-temporal#72 started. Previous commits avoided mutation of params only where the types changed. This commit adds eslint support for preventing param mutation and makes changes that don't change the underlying type. I split into a separate commit in case we want to make this a new PR.
Fixed for PlainDate, PlainDateTime, PlainMonthDay, PlainTime, and PlainYearMonth so as not to clobber @justingrant's work on fixing up types for the other files (not sure how cleanly the PRs would merge).