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

[typescript/indent] Crash #80

Closed
ficristo opened this issue Jan 19, 2019 · 0 comments · Fixed by #89
Closed

[typescript/indent] Crash #80

ficristo opened this issue Jan 19, 2019 · 0 comments · Fixed by #89
Assignees
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@ficristo
Copy link

Repro

{
  "rules": {
    "indent": "off",
    "typescript/indent": ["error", 4, { "SwitchCase": 1 }]
  }
}

I don't know which code throw the problem.
The repo is available here:
https://github.com/quadre-code/quadre-git/tree/9a7f6b7226473e67f433217d25b80a6bf8d4a094

Expected Result
Not crash

Actual Result

TypeError: context.report() called with a messageId, but no messages were present in the rule metadata.
    at args (<...>\quadre-git\node_modules\eslint\lib\util\report-translator.js:252:23)
    at Object.report (<...>\quadre-git\node_modules\eslint\lib\linter.js:720:41)
    at report (<...>\quadre-git\node_modules\eslint\lib\rules\indent.js:712:21)
    at Program:exit.sourceCode.lines.forEach (<...>\quadre-git\node_modules\eslint\lib\rules\indent.js:1599:25)
    at Array.forEach (<anonymous>)
    at Program:exit (<...>\quadre-git\node_modules\eslint\lib\rules\indent.js:1560:38)
    at listeners.(anonymous function).forEach.listener (<...>\quadre-git\node_modules\eslint\lib\util\safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (<...>\quadre-git\node_modules\eslint\lib\util\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (<...>\quadre-git\node_modules\eslint\lib\util\node-event-generator.js:251:26)

Additional Info
Log taken with ./node_modules/.bin/eslint --ext .ts ./src --debug &> eslint-log.txt
eslint-log.txt

In my editor I also see this log, I don't know if it is related.

Error thrown in executeOnText: TypeError: Cannot read property 'range' of undefined
    at SourceCode.getFirstTokenBetween (<...>\quadre-git\node_modules\eslint\lib\token-store\index.js:340:18)
    at Object.BinaryExpression, LogicalExpression [as listener] (<...>\quadre-git\node_modules\eslint\lib\rules\indent.js:1068:45)
    at Program:exit.listenerCallQueue.filter.forEach.nodeInfo (<...>\quadre-git\node_modules\eslint\lib\rules\indent.js:1543:55)
    at Array.forEach (<anonymous>)
    at Program:exit (<...>\quadre-git\node_modules\eslint\lib\rules\indent.js:1543:26)
    at listeners.(anonymous function).forEach.listener (<...>\quadre-git\node_modules\eslint\lib\util\safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (<...>\quadre-git\node_modules\eslint\lib\util\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (<...>\quadre-git\node_modules\eslint\lib\util\node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (<...>\quadre-git\node_modules\eslint\lib\util\node-event-generator.js:280:22)

Versions

package version
eslint-plugin-typescript 1.0.0-rc.3
typescript-eslint-parser eslint-plugin-typescript/parser
typescript 3.1.6
@ficristo ficristo added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jan 19, 2019
@armano2 armano2 added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for maintainers to take a look labels Jan 19, 2019
@armano2 armano2 self-assigned this Jan 19, 2019
@armano2 armano2 added bug Something isn't working and removed awaiting response Issues waiting for a reply from the OP or another party labels Jan 20, 2019
@typescript-eslint typescript-eslint locked as resolved and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants