Gelio / tslint-react-hooks

TSLint rule for detecting invalid uses of React Hooks
MIT License
218 stars 10 forks source link

[Bug] Unable to enable "warning" mode #21

Closed infinityl00p closed 5 years ago

infinityl00p commented 5 years ago

Hi,

I've introduced this library to one of my projects. However, I'm having an issue with my config` file. It successfully shows errors, but it does not warn. Therefore I am unable to successfully run my app with "warning" mode enabled, because it continues showing errors in warning mode.

In my tslint.json, I have the following:

  "extends": [
    "tslint-react-hooks",
  ],
   ...
  "rules": {
    "react-hooks-nesting": "warning",
   }

package versions: "tslint-react-hooks": "2.1.1", "react": "16.8.4", "typescript": "3.1.5",

Any help would be greatly appreciated!

Gelio commented 5 years ago

Thanks for filing an issue!

The rule does not have a hard-coded violation type, therefore it may be a configuration error

  1. Did you check that the rule only reports errors using your IDE? If yes, then please run tslint using the CLI and check there.
  2. Could you check if warnings can be shown for any other tslint rule in your configuration?
  3. If you are using vscode, please take a look at your tslint extension configuration. I remember there was a setting that determines whether rule violations are warnings or errors, regardless of the tslint config.

If none of the above work and you still can't get the rule to show warnings, could you create a repository with the problem? I will be able to check it out 👀 thanks!

Gelio commented 5 years ago

@infinityl00p Does the problem still occur? If yes, please take a look at my previous comment 🙂 If not, then let's close the issue.

I will close the issue if there is no answer in the next 2 days.

Gelio commented 5 years ago

I am closing this issue due to lack of response from the author