-
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
Enable parsing of accessor
keyword
#580
Comments
accessor
keyword
Would you be able to add the content you were trying to transform, the transformation script you wrote, the command you ran to transform it, and the expected output, to the issue? |
I think this will need upstream changes (recast and/or ast-types) |
@ElonVolo Here is a simple case. Basically, I just want it to run without any errors. Hope this is enough information for you. // test-file.ts
export class Test {
public accessor myValue = 10;
} // test-transform.ts
import { FileInfo, API, Options } from 'jscodeshift';
module.exports = function (file: FileInfo, { j }: API, _options: Options) {
const root = j(file.source);
// Do nothing just output the file again
return root.toSource();
}; BTW: I noticed that this is already supported by babel but the plugin for it does need to be configured. Could that be the problem in this case? |
I'm running the transform and file code you submitted and I'm not getting any errors. Nothing's being transformed, which is expected as no modifications have been made. Are you getting some different result on your end? |
I looked at the recast code and there does seem to be some support for Typescript's accessor keyword. |
@ElonVolo I definitely get an error. There is no error message, it just prints out results 1 error instead of 1 unmodified. I have created an isolated test case and included it here. To see the error, run |
It looks like jscodeshift does not currently support the accessor keyword that was added typescript in 3.9. Can we please add support for this. Thank you.
microsoft/TypeScript#49705
https://github.com/tc39/proposal-decorators
The text was updated successfully, but these errors were encountered: