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

Support for TypeScript 4.8 decorator AST changes #249

Merged
merged 7 commits into from Dec 13, 2022

Conversation

bicknellr
Copy link
Contributor

@bicknellr bicknellr commented Oct 14, 2022

This PR adds TypeScript 4.8 to the set of TypeScript versions that are tested. TypeScript 4.8 has a breaking change to the AST where the .decorators property has been deprecated and decorators are now found in the .modifiers property.1 This PR introduces a new getDecorators function that returns all decorators existing in either array, if they exist.

Footnotes

  1. https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#decorators-are-placed-on-modifiers-on-typescripts-syntax-trees

@bicknellr bicknellr changed the title Test on TypeScript 4.8 Support for TypeScript 4.8 decorator AST changes Oct 17, 2022
@bicknellr bicknellr marked this pull request as ready for review December 6, 2022 21:09
@SimonAlling
Copy link

SimonAlling commented Mar 9, 2023

Now that this PR has been merged, a new release would be highly appreciated, so that runem/lit-analyzer#278 can be fixed. Perhaps @runem or @rictic can help? 🙂

bicknellr added a commit to bicknellr/web-component-analyzer that referenced this pull request Apr 5, 2023
bicknellr added a commit to bicknellr/web-component-analyzer that referenced this pull request Apr 5, 2023
rictic pushed a commit that referenced this pull request Apr 6, 2023
* Install `typescript@~5.0`.

* Add `5.0` to the set of tested TypeScript versions.

* Support for TypeScript 4.8+ decorator AST changes (cherry-pick of #249)

* Fall back to `isTypeAssertion` for `isTypeAssertionExpression` (introduced in `4.0.2`). (cherry-pick c69e804)

* Fix building with TypeScript before `isTypeAssertionExpression` existed.

* Remove indentation from JSDoc descriptions in tests. (...)

Somewhere between 3.8 and 5.0, indentation for JSDoc description lines starting
with whitespace was fixed to not include the additional space immediately after
the line's leading `*`. The indentiation in this test causes it to fail in at
least TS 5.0, so I'm removing it rather than trying to track down exactly when
this change was made and then propagating the version number to the test.

* `DocumentAndElementEventHandlers` was removed in microsoft/TypeScript#52328 (0c2fa39).

* Revert back to `lockfileVersion: 1` by installing new deps with npm v6 instead of v9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants