-
Notifications
You must be signed in to change notification settings - Fork 481
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: add decoratorAutoAccessors plugin #594
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi @syi0808! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Can you please provide an example of code that requires this option? |
Here's an example, @Daniel15 https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html To kill two birds with one stone, I think it would be great if in addition to providing the awesome fix for this bug, syi0808 could also add a unit test(s) that make use of the accessor keyword in some example code and then makes sure the manipulation of it comes out correctly. That way we can guard against any future regressions with the parsing. |
I encountered this problem too. Looking forward to it. |
@@ -0,0 +1,10 @@ | |||
"use strict"; |
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.
Can these go in the existing src/__tests__
directory?
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.
Okay. I moved the test.
const defineTest = require("../../src/testUtils").defineTest; | ||
|
||
describe("should be parse typescript decoratorAutoAccessors correctly", function () { | ||
defineTest(__dirname, "ts-decorator-auto-accessor", null, null, { |
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.
Please use defineInlineTest
. You can also define the transform inline if you use defineInlineTest
, e.g.
function transformer(file, api) {
.....
}
defineInlineTest(transformer, .......)
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.
Thanks for review. I switched to inline test.
Sorry for the delay in getting back to this. I added some comments inline. |
Thanks! I'll push a new release with this change this week some time, depending on the timing of #611. |
defineInlineTest( | ||
transformer, | ||
{}, | ||
'export class Test {\n' + |
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 could use template strings to avoid the concatenation, but we can change it separately :)
Released in v17.0.0. Thanks for your contribution! |
add decoratorAutoAccessors plugin in typescript parser plugins to solve error.
before screenshot
after screenshot
fix: #580