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 }}
Repository navigation
[eslint] no-extra-semi rule crashes on class declaration #9
The following code crashes the no-extra-semi rule:
EntityStore(identify, equalityTest) ->
class z extends ReduxComponent:
constructor() -> super()
with the following stacktrace:
Cannot read property 'type' of null
TypeError: Cannot read property 'type' of null
at checkForPartOfClassBody (/Users/wcj/dev/node_modules/lightscript-eslint/node_modules/eslint/lib/rules/no-extra-semi.js:63:22)
at EventEmitter.MethodDefinition (/Users/wcj/dev/node_modules/lightscript-eslint/node_modules/eslint/lib/rules/no-extra-semi.js:112:17)
at emitOne (events.js:101:20)
at EventEmitter.emit (events.js:188:7)
at NodeEventGenerator.applySelector (/Users/wcj/dev/node_modules/lightscript-eslint/node_modules/eslint/lib/util/node-event-generator.js:265:26)
at NodeEventGenerator.applySelectors (/Users/wcj/dev/node_modules/lightscript-eslint/node_modules/eslint/lib/util/node-event-generator.js:294:22)
at NodeEventGenerator.enterNode (/Users/wcj/dev/node_modules/lightscript-eslint/node_modules/eslint/lib/util/node-event-generator.js:308:14)
at CodePathAnalyzer.enterNode (/Users/wcj/dev/node_modules/lightscript-eslint/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:602:23)
at CommentEventGenerator.enterNode (/Users/wcj/dev/node_modules/lightscript-eslint/node_modules/eslint/lib/util/comment-event-generator.js:98:23)
at Traverser.enter (/Users/wcj/dev/node_modules/lightscript-eslint/node_modules/eslint/lib/eslint.js:928:36)
I saw this as well. Using curly braces instead of : for the class declaration dodges the bug too. Problem is it's looking for a closing } in the tokens list. Will probably require monkeypatching. Not sure how to tell it "you're not in a class anymore" based purely on tokens though...
changed the title [-]`lightscript-eslint`: `no-extra-semi` rule crashes on class declaration[/-][+][eslint] `no-extra-semi` rule crashes on class declaration[/+]on Apr 13, 2017
Activity
rattrayalex commentedon Mar 26, 2017
I saw this as well. Using curly braces instead of
:for the class declaration dodges the bug too. Problem is it's looking for a closing}in the tokens list. Will probably require monkeypatching. Not sure how to tell it "you're not in a class anymore" based purely on tokens though...[-]`lightscript-eslint`: `no-extra-semi` rule crashes on class declaration[/-][+][eslint] `no-extra-semi` rule crashes on class declaration[/+]