Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

exporting an anonymous default function crashes tslint #456

Closed
UhhhWaitWhat opened this issue Jun 23, 2015 · 6 comments
Closed

exporting an anonymous default function crashes tslint #456

UhhhWaitWhat opened this issue Jun 23, 2015 · 6 comments

Comments

@UhhhWaitWhat
Copy link

Exactly like the title says,

export default function() {}

results in the following crash:

var variableName = node.name.text;
                                    ^
TypeError: Cannot read property 'text' of undefined
    at NoUnusedVariablesWalker.visitFunctionDeclaration (/home/florian/dev/modules/node-kodi-remote/node_modules/tslint/build/rules/noUnusedVariableRule.js:118:37)
    at NoUnusedVariablesWalker.SyntaxWalker.visitNode (/home/florian/dev/modules/node-kodi-remote/node_modules/tslint/bin/tslint-cli.js:41519:26)
    at /home/florian/dev/modules/node-kodi-remote/node_modules/tslint/bin/tslint-cli.js:41639:67
    at visitEachNode (/home/florian/dev/modules/node-kodi-remote/node_modules/tslint/bin/tslint-cli.js:5928:30)
    at Object.forEachChild (/home/florian/dev/modules/node-kodi-remote/node_modules/tslint/bin/tslint-cli.js:6070:24)
    at NoUnusedVariablesWalker.SyntaxWalker.walkChildren (/home/florian/dev/modules/node-kodi-remote/node_modules/tslint/bin/tslint-cli.js:41639:16)
    at NoUnusedVariablesWalker.SyntaxWalker.visitSourceFile (/home/florian/dev/modules/node-kodi-remote/node_modules/tslint/bin/tslint-cli.js:41412:18)
    at NoUnusedVariablesWalker.SyntaxWalker.visitNode (/home/florian/dev/modules/node-kodi-remote/node_modules/tslint/bin/tslint-cli.js:41603:26)
    at NoUnusedVariablesWalker.SyntaxWalker.walk (/home/florian/dev/modules/node-kodi-remote/node_modules/tslint/bin/tslint-cli.js:41253:18)
    at Rule.AbstractRule.applyWithWalker (/home/florian/dev/modules/node-kodi-remote/node_modules/tslint/bin/tslint-cli.js:41768:24)

I think the fix should be pretty straightforward and I would submit a pull request myself, but in its current state I cannot get the codebase to build, so I cannot really go about fixing it. This was tested in tslint@2.3.0-beta straight from npm.

@leeavital
Copy link
Contributor

What rules are you using?

@adidahiya
Copy link
Contributor

looks like no-unused-variable rule is crashing

@ashwinr
Copy link
Contributor

ashwinr commented Jun 23, 2015

:(

@lukeapage
Copy link
Contributor

any chance of a release? this is catching us out...

@adidahiya
Copy link
Contributor

@lukeapage we're likely going to make a release today which includes a fix for #469 as well

@lukeapage
Copy link
Contributor

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants