You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
Note: in tsconfig.json I have already added:
....
"exclude": ["node_modules"]
Actual behavior
TypeError: Cannot read property 'end' of undefined
at cb (.....\node_modules\tslint\lib\rules\trailingCommaRule.js:163:133)
at visitNode (....\node_modules\typescript\lib\typescript.js:13990:24)
at Object.forEachChild (....\node_modules\typescript\lib\typescript.js:14109:21)
at cb (.....\node_modules\tslint\lib\rules\trailingCommaRule.js:170:23)
at visitNode (.....\node_modules\typescript\lib\typescript.js:13990:24)
at Object.forEachChild (....\node_modules\typescript\lib\typescript.js:14204:21)
at cb (....\node_modules\tslint\lib\rules\trailingCommaRule.js:170:23)
at visitNode (....\node_modules\typescript\lib\typescript.js:13990:24)
at Object.forEachChild (....\node_modules\typescript\lib\typescript.js:14251:24)
at cb (....\src\node_modules\tslint\lib\rules\trailingCommaRule.js:170:23)
Expected behavior
Running without error.
I have tried (I know it is not nice, was just experiment) to rewrite ...node_modules\tslint\lib\rules\trailingCommaRule.js at line 162. I have added the same if === undefined, like you guys also did in case of ArrowFunction and it is working like charm.
Can it be that I was looking over something or it is an error in the Force?
Or probably the main problem that the JS files are not excluded.
The text was updated successfully, but these errors were encountered:
@SophieLeeroy it sounds like you've found a solution (great!) but it's hard to verify the problem or write tests for it without a code snippet that can reproduce the crash. Any chance you can share the specific .ts/.tsx file it crashes on?
Since you're already playing around with the compiled TSLint js, if you add a console log for sourceFile.fileName on line 163 of trailingCommaRule.js it'll tell you which file(s) it's crashing on:
hi @JoshuaKGoldberg thanks for the help!
I did it and funnily (or not) it is my bundle.js...hmm... I still belive that my JS files create the error, since I have the project without them too and there it is working without issues.
I am using ChartJS library with React and TypeScript. I will try to extract ithe corresponding codeparts to an app that you can check it as well.
Oh my! ...front-end/public/js/bundle.js TypeError: Cannot read property 'end' of undefined at TrailingCommaWalker.checkTypeLiteral (....\node_modules\tslint\lib\rules\trailingCommaRule.js:181:20) at cb (...\node_modules\tslint\lib\rules\trailingCommaRule.js:171:27)
👋 @SophieLeeroy - closing this issue as non-actionable for now, but if this is still showing up for you, please do post those codeparts and we can take another look!
Bug Report
TypeScript code being linted
lot of .ts and .tsx files and 3 pure JavaScript files
Note: in tsconfig.json I have already added:
....
"exclude": ["node_modules"]
Actual behavior
TypeError: Cannot read property 'end' of undefined
at cb (.....\node_modules\tslint\lib\rules\trailingCommaRule.js:163:133)
at visitNode (....\node_modules\typescript\lib\typescript.js:13990:24)
at Object.forEachChild (....\node_modules\typescript\lib\typescript.js:14109:21)
at cb (.....\node_modules\tslint\lib\rules\trailingCommaRule.js:170:23)
at visitNode (.....\node_modules\typescript\lib\typescript.js:13990:24)
at Object.forEachChild (....\node_modules\typescript\lib\typescript.js:14204:21)
at cb (....\node_modules\tslint\lib\rules\trailingCommaRule.js:170:23)
at visitNode (....\node_modules\typescript\lib\typescript.js:13990:24)
at Object.forEachChild (....\node_modules\typescript\lib\typescript.js:14251:24)
at cb (....\src\node_modules\tslint\lib\rules\trailingCommaRule.js:170:23)
Expected behavior
Running without error.
I have tried (I know it is not nice, was just experiment) to rewrite ...node_modules\tslint\lib\rules\trailingCommaRule.js at line 162. I have added the same if === undefined, like you guys also did in case of ArrowFunction and it is working like charm.
Can it be that I was looking over something or it is an error in the Force?
Or probably the main problem that the JS files are not excluded.
The text was updated successfully, but these errors were encountered: