Skip to content

Bug: Rules with suggestions must set the meta.hasSuggestions property to true #22545

Closed
@pkelly-rh

Description

@pkelly-rh

I'm basically running into an issue where eslint is asking me to set meta.hasSuggestions to true. When I use "react-hooks/exhaustive-deps": "error". Is there something I'm doing wrong or is this a dep version thing?

React version:

Steps To Reproduce

  1. Have my eslint config:
{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": [
    "eslint:recommended",
    "plugin:react/recommended",
    "plugin:react-hooks/recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 13,
    "sourceType": "module"
  },
  "plugins": ["react", "react-hooks", "@typescript-eslint"],
  "rules": {
    "react-hooks/exhaustive-deps": "error",
  },
  "settings": {
    "react": {
      "version": "detect"
    }
  }
}

Here's my deps from package.json

{
"dependecies": {
    "eslint": "^8.0.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-react": "^7.26.1",
    "eslint-plugin-react-hooks": "^4.2.0",
}

If I try to remove the react-hook plugin and extension this happens:
Definition for rule 'react-hooks/exhaustive-deps' was not found

Link to code example:

The current behavior

The expected behavior

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions