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

Error messages should include rule name #3290

Closed
mgol opened this issue Oct 6, 2017 · 1 comment
Closed

Error messages should include rule name #3290

mgol opened this issue Oct 6, 2017 · 1 comment

Comments

@mgol
Copy link

mgol commented Oct 6, 2017

Bug Report

  • TSLint version: 5.7.0
  • TypeScript version: 2.3.4
  • Running TSLint via: CLI

TypeScript code being linted

Promise.resolve('foo');

with tslint.json configuration:

{
  "rules": {
    "no-floating-promises": true
  }
}

Actual behavior

Running tslint --project . file.ts reports:

ERROR: /full/path/to/files.ts[1, 1]: Promises must be handled appropriately

Expected behavior

I'd expect something like:

ERROR (no-floating-promises): /full/path/to/files.ts[1, 1]: Promises must be handled appropriately

Sometimes an error might be unexpected and we might want to disable the rule that causes it. When you have a large config, though, it may not be obvious which rule reports a particular error.

ESLint formatters print the name of the rule that detects the error.

@ajafff
Copy link
Contributor

ajafff commented Oct 6, 2017

Use the verbose formatter by adding -t verbose CLI command.

The rest of the issue is a duplicate of #2228

@ajafff ajafff closed this as completed Oct 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants