1.3.0 • Published 2 years ago

eslint-plugin-react-query v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Quick Start

Installation

Install the plugin:

npm install --save-dev eslint-plugin-react-query

Usage

Add react-query to plugins field in your .eslintrc configuration file:

{
  "plugins": ["react-query"],
  "rules": {
    "react-query/rule-name": "error"
  }
}

You can also use recommended rules with this plugin:

{
  "extends": ["plugin:react-query/recommended"]
}

Supported Rules

Key: ✅ = recommended, 🔧 = fixable

NameDescription🔧
mutation-keyEnforce mutationKey to be present in useMutation call
prefer-query-object-syntaxPrefer object syntax for useQuery🔧
query-keyEnforce queryKey to be present in useQuery object syntax

Contributing

Check out CONTRIBUTING.md for information on how to contribute to the project.

Attributions

Big thanks to Testing Library team for the code inspiration.