-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
*.tsx parser fails #201
Comments
that PR worked for me, might want to submit a PR |
I am sorry that, I don't notice this issue. Why TypeScript compiler not happy with your code? How does it happen? |
As I can see the problem is that As I still can repro the issue and Setup repo: npm run bootstrap This command will install all dependencies. Check that ts code is ok: npm run build This command will transpile ts using Check that depcheck is fail: npm run test And finally, this one will run depcheck again to packages (both should have errors). The result should be like (cutted): npm run test Projects/depcheck-ts-bug master
> depcheck-ts-bug@1.0.0 test ../depcheck-ts-bug
> node scripts/check.js
[CHECK] ../depcheck-ts-bug/packages/pkg-test-one/
[RESULT]
{ dependencies: [ 'react', 'react-materialize', [length]: 2 ],
devDependencies: [ [length]: 0 ],
missing: {},
using: {},
invalidFiles:
{ '../depcheck-ts-bug/packages/pkg-test-one/src/test-one.tsx':
{ SyntaxError: Unexpected token (7:8)
at Parser.pp$5.raise (../depcheck-ts-bug/node_modules/babylon/lib/index.js:4454:13)
...
at Parser.pp$1.parseStatement (../depcheck-ts-bug/node_modules/babylon/lib/index.js:1906:19)',
[message]: 'Unexpected token (7:8)',
pos: 234,
loc: Position { line: 7, column: 8 } } },
invalidDirs: {} }
[/RESULT]
[/CHECK]
[CHECK] ../depcheck-ts-bug/packages/pkg-test-two/
[RESULT]
{ dependencies: [ 'react', 'react-materialize', [length]: 2 ],
devDependencies: [ [length]: 0 ],
missing: {},
using: {},
invalidFiles:
{ '../depcheck-ts-bug/packages/pkg-test-two/src/sub-test.two.tsx':
{ SyntaxError: Unexpected token (6:8)
at Parser.pp$5.raise (../depcheck-ts-bug/node_modules/babylon/lib/index.js:4454:13)
...
at Parser.pp$1.parseStatement (../depcheck-ts-bug/node_modules/babylon/lib/index.js:1906:19)',
[message]: 'Unexpected token (6:8)',
pos: 179,
loc: Position { line: 6, column: 8 } },
'../depcheck-ts-bug/packages/pkg-test-two/src/test-two.tsx':
{ SyntaxError: Unexpected token (7:8)
at Parser.pp$5.raise (../depcheck-ts-bug/node_modules/babylon/lib/index.js:4454:13)
...
at Parser.pp$1.parseStatement (../depcheck-ts-bug/node_modules/babylon/lib/index.js:1906:19)',
[message]: 'Unexpected token (7:8)',
pos: 226,
loc: Position { line: 7, column: 8 } } },
invalidDirs: {} }
[/RESULT]
[/CHECK] |
I see. I suppose that is controlled here: depcheck/src/parser/typescript.js Lines 11 to 14 in 153aa50
We need to change this hard coded compile option to read it from file. Not sure if TypeScript provides util to help here. @yurii-sorokin Could you please help on this issue? |
I could, I just can't give any estimations. |
Hey, @ubnt-marc-khouri I am sorry that, I really don't have time to continue working on this project. If you are interested in fixing these issue, please tell me and I will loop you as contributors. |
Fixed by #230 |
Thanks @yurii-sorokin ! |
Hi. I've tried to use depcheck with tsx files + typescript@2, but with no luck. I reciving parsing error like:
To reproduce go to test/fake_modules/typescript and change component.tsx from
to
and run tests.
You will see that there are 2 failing tests. Both about typescript parser.
The text was updated successfully, but these errors were encountered: