Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Upgrade to TypeScript 3.8 #4915

Merged
merged 4 commits into from Mar 10, 2020
Merged

Upgrade to TypeScript 3.8 #4915

merged 4 commits into from Mar 10, 2020

Conversation

rrdelaney
Copy link
Contributor

@rrdelaney rrdelaney commented Feb 27, 2020

PR checklist

Overview of change:

TypeScript 3.8 changed several AST types to support private fields and export * as ns syntax. This change retains existing functionality but allows TSLint to compile using TypeScript 3.8. I'm not sure this addresses any issues in #4888, however the entire test suite seems to pass.

CHANGELOG.md entry:

[enhancement] Upgrade to TypeScript 3.8

TypeScript 3.8 changed several AST types to support private fields and
`export * as ns` syntax. This change retains existing functionality but
allows TSLint to compile using TypeScript 3.8.
@palantirtech
Copy link
Member

Thanks for your interest in palantir/tslint, @rrdelaney! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@rrdelaney
Copy link
Contributor Author

rrdelaney commented Feb 27, 2020

Need to talk to my team about the CLA.

Didn't meant to close this!

@rrdelaney rrdelaney closed this Feb 27, 2020
@rrdelaney rrdelaney reopened this Feb 27, 2020
@palantirtech
Copy link
Member

Thanks for your interest in palantir/tslint, @rrdelaney! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@rrdelaney
Copy link
Contributor Author

@JoshuaKGoldberg Most tests are failing on older versions of TypeScript, however to detect new AST features newer versions of TypeScript are needed. Is it OK to merge this and release as a major version without compatibility for <3.8?

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A start!

src/rules/importBlacklistRule.ts Outdated Show resolved Hide resolved
@rrdelaney
Copy link
Contributor Author

I fixed up the lint warnings! Unfortunately some of the syntax I used in my new helper tripped up Prettier, so I had to update it 😅 This change is now a bit larger, but most of it is just formatting.

@rrdelaney
Copy link
Contributor Author

Sorry for all the force pushes! Upgrading prettier made far too many changes for this to be reasonable, so I reverted that change and used different syntax for my helper.

As far as the CLA, I am a Google employee and was told we have a generic CLA approved for all Googlers.

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source code changes look great, thanks! 🙌

We'll just need some test coverage to get this through the door. You can use #if typescript > X.Y to target a specific version range.

is an example in source.

Separately, I can work on getting more TypeScript version ranges tested.

@rrdelaney
Copy link
Contributor Author

@JoshuaKGoldberg thanks for the review! I just got back from vacation and am picking this up again 😄

Of the four rules that I touched, only 1 introduced a new branch or condition: noUnnecessaryQualifierRule.ts. I added a test case here to ensure that private fields are handled and pass the lint. The other changes that were made preserve current behavior and intentionally skip over the new syntax forms: export * as ns, import type and export type. These will be ignored for lint checks, and for example will not be tested for whitespace. For coverage I could add these to the test case files as sort of a spec of what is ignored, or I could augment the functionality in TSLint to handle the new syntax. Which do you think would be a better way forward?

@JoshuaKGoldberg
Copy link
Contributor

This is great, thanks @rrdelaney! I'd say since the tests are all passing and the code looks clean, let's leave it as is - there can always be a new issue + PR if critical breaking changes are observed for the unrelated syntaxes.

...and welcome back 😄

@adidahiya
Copy link
Contributor

@rrdelaney can you please merge in origin/develop to get the latest CI workflow configuration?

@rrdelaney
Copy link
Contributor Author

@adidahiya Thanks, looks like all tests are passing now!

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JoshuaKGoldberg
Copy link
Contributor

I can't merge this without the CLA being signed, unfortunately (I'm not an admin on this repository). So either you'll need to manually re-sign the CLA (is that doable on your end?) or we'll need to get an admin here to merge.

@rrdelaney
Copy link
Contributor Author

Thanks for the review Josh!

@adidahiya would it be possible to merge this? Google should have a CLA signed with Palantir outside of the individual requests. See #4635 and #2164 as examples of other Googlers merging PR's to this repo.

@adidahiya adidahiya merged commit cf2f454 into palantir:master Mar 10, 2020
alan-agius4 added a commit to alan-agius4/codelyzer that referenced this pull request Mar 12, 2020
Tslint 6.0+ adds support for TypeScript 3.8 syntax. 

palantir/tslint#4915
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript >=3.8 Support
4 participants