Skip to content

TypeError: context.report() called with a messageId, but no messages were present in the rule metadata #96

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

Closed
vbrvk opened this issue Jan 20, 2019 · 6 comments · Fixed by #89 or #97
Labels
package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look

Comments

@vbrvk
Copy link

vbrvk commented Jan 20, 2019

Repro

{
  "extends": ["plugin:@typescript-eslint/recommended"], // actually error happens when i add this line
  "plugins": ["@typescript-eslint/eslint-plugin"],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": 2018,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true
    }
  },
  "settings": {
    "import/resolver": {
      "node": {
        "extensions": [".js", ".jsx", ".ts", ".tsx", ".json"]
      }
    }
  }
}
any file

Expected Result

Actual Result

Additional Info

[Error - 11:09:59 PM] ESLint stack trace:
[Error - 11:09:59 PM] TypeError: context.report() called with a messageId, but no messages were present in the rule metadata.
    at args (/Users/vladimir/projects/tatt-battle/client/node_modules/eslint/lib/util/report-translator.js:252:23)
    at Object.report (/Users/vladimir/projects/tatt-battle/client/node_modules/eslint/lib/linter.js:720:41)
    at report (/Users/vladimir/projects/tatt-battle/client/node_modules/eslint/lib/rules/indent.js:712:21)
    at Program:exit.sourceCode.lines.forEach (/Users/vladimir/projects/tatt-battle/client/node_modules/eslint/lib/rules/indent.js:1599:25)
    at Array.forEach (<anonymous>)
    at Program:exit (/Users/vladimir/projects/tatt-battle/client/node_modules/eslint/lib/rules/indent.js:1560:38)
    at listeners.(anonymous function).forEach.listener (/Users/vladimir/projects/tatt-battle/client/node_modules/eslint/lib/util/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/vladimir/projects/tatt-battle/client/node_modules/eslint/lib/util/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/vladimir/projects/tatt-battle/client/node_modules/eslint/lib/util/node-event-generator.js:251:26)

Versions

package version
@typescript-eslint/eslint-plugin ^0.2.1
@typescript-eslint/parser ^0.2.1
typescript ^3.2.4
@vbrvk vbrvk added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jan 20, 2019
@JamesHenry
Copy link
Member

I haven't been able to check if more than one form is supported, so this might not be it, but for plugins you only need this:

"plugins": ["@typescript-eslint"],

I can investigate in a little while if I don't hear back from you

@vbrvk
Copy link
Author

vbrvk commented Jan 20, 2019

Same error if I have

"extends": ["plugin:@typescript-eslint/recommended"],
"plugins": ["@typescript-eslint"],

@JamesHenry
Copy link
Member

Cool, thanks for confirming, what version of ESLint are you using?

@vbrvk
Copy link
Author

vbrvk commented Jan 20, 2019

"eslint": "^5.12.1"

@JamesHenry
Copy link
Member

(Thanks, I've updated our issue templates so that they more consistently ask for that info too)

@JamesHenry
Copy link
Member

I'll be releasing 1.0.0 shortly, please let me know if that doesn't fix the issue

armanio123 pushed a commit to armanio123/typescript-eslint that referenced this issue Jan 24, 2019
…eslint#219)

Fixes typescript-eslint#201
Fixes typescript-eslint#96
Fixes eslint/typescript-eslint-parser#577

The [base eslint implementation](https://github.com/eslint/eslint/blob/master/lib/rules/indent.js) purposely ignores nodes it doesn't know about (i.e. our TS nodes).

Because of how the base rule is written, we have to override the implementation entirely.
@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
package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look
Projects
None yet
2 participants