Rules
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
import { useQuery } from "@tanstack/react-query";
function Todo({ todoId }) {
const query = useQuery({
queryKey: ["todo"],
queryFn: () => fetchTodo(todoId),
});
}import { useQuery } from "@tanstack/react-query";
function Todo({ todoId }) {
const todos = useTodos();
const query = useQuery({
queryKey: ["todo", todoId],
queryFn: () => todos.getTodo(todoId),
});
}
const todoQueries = {
detail: (id) => ({ queryKey: ["todo", id], queryFn: () => fetchTodo(id) }),
};Popular · 1 of 50
Require query keys to include every value that the query function uses.
import { useQuery } from "@tanstack/react-query";
function Todo({ todoId }) {
const query = useQuery({
queryKey: ["todo"],
queryFn: () => fetchTodo(todoId),
});
}import { useQuery } from "@tanstack/react-query";
function Todo({ todoId }) {
const todos = useTodos();
const query = useQuery({
queryKey: ["todo", todoId],
queryFn: () => todos.getTodo(todoId),
});
}
const todoQueries = {
detail: (id) => ({ queryKey: ["todo", id], queryFn: () => fetchTodo(id) }),
};