Skip to content
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

fix(typescript-estree): correct AST regression introduced by TS4.0 upgrade #2316

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

bradzacher
Copy link
Member

@bradzacher bradzacher commented Jul 21, 2020

Reference: prettier/prettier#8805

I had a major brainfart when implementing #2305 and didn't think about the fact that changes should be backwards compatible.

When handling the null type change introduced by 4.0, I deleted the old branches instead of gating them behind a version check. This PR just gates the old logic for < 4.0.

We don't have automated testing against old TS versions yet (#1752) so I tested this by hand by doing the following:

  • yarn build to build against 4.0.0-beta.
  • change the resolved ts version to 3.9.7
  • yarn install --ignore-scripts (the automatic rebuild after the install would fail due to incorrect types)
  • cd packages/typescript-estree && yarn test ast-fixtures
  • inspected the test output to ensure the only failures were due to fixtures for 4.0 features.

cc @thorn0 / @fisker

@bradzacher bradzacher added the bug Something isn't working label Jul 21, 2020
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@codecov
Copy link

codecov bot commented Jul 21, 2020

Codecov Report

Merging #2316 into master will decrease coverage by 0.01%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master    #2316      +/-   ##
==========================================
- Coverage   93.10%   93.09%   -0.02%     
==========================================
  Files         283      284       +1     
  Lines        9081     9092      +11     
  Branches     2493     2495       +2     
==========================================
+ Hits         8455     8464       +9     
- Misses        301      302       +1     
- Partials      325      326       +1     
Flag Coverage Δ
#unittest 93.09% <80.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/typescript-estree/src/node-utils.ts 96.72% <50.00%> (-0.02%) ⬇️
packages/typescript-estree/src/convert.ts 98.35% <60.00%> (-0.27%) ⬇️
packages/typescript-estree/src/version-check.ts 100.00% <100.00%> (ø)

@bradzacher bradzacher merged commit d7fefba into master Jul 21, 2020
@bradzacher bradzacher deleted the fix-4.0-ast-regression branch July 21, 2020 18:20
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[no-type-alias] Rule fails with "Unhandled in union types are not allowed." when encountering null
1 participant