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

[Feature]: Codemod does not transform tsx files in project tagspaces #692

Open
1 task
trivikr opened this issue Nov 6, 2023 · 0 comments
Open
1 task
Labels
enhancement New feature or request p2 This is a standard priority issue

Comments

@trivikr
Copy link
Member

trivikr commented Nov 6, 2023

Self-service

  • I'd be willing to implement this feature

Problem

Codemod does not transform tsx files in project tagspaces

$ npx [email protected] -t v2-to-v3 app/containers/MainPage.tsx
...
 ERR app/containers/MainPage.tsx Transformation error (Unexpected token, expected "," (213:10))
SyntaxError: Unexpected token, expected "," (213:10)
    at constructor (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:356:19)
    at TypeScriptParserMixin.raise (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:3223:19)
    at TypeScriptParserMixin.unexpected (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:3253:16)
    at TypeScriptParserMixin.expect (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:3590:28)
    at TypeScriptParserMixin.tsParseDelimitedListWorker (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:7819:14)
    at TypeScriptParserMixin.tsParseDelimitedList (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:7796:25)
    at TypeScriptParserMixin.tsParseBracketedList (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:7836:25)
    at TypeScriptParserMixin.tsParseTypeParameters (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:7930:24)
    at /local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:9654:29
    at TypeScriptParserMixin.tryParse (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:3597:20)

From the error, it appears that the issue is with parser, and not source code.

Solution

Add ability to transform TSX files in codemod

Alternatives

N/A

Additional context

https://github.com/tagspaces/tagspaces/blob/c4a6f1694c6ef9b50c70f7231f3dbbf28e3d18eb/app/containers/MainPage.tsx#L27

@trivikr trivikr added enhancement New feature or request p2 This is a standard priority issue labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

1 participant