Skip to content

eslint-plugin: prefer-query-object-syntax shows error when object is a constant #4450

@wight554

Description

@wight554

Describe the bug

When object is a constant, plugin doesn't recognize it is an object

Your minimal, reproducible example

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgVwM4FMCKz1QJ5wC+cAZlBCHAOQACMAhgHaoMDGA1gPRTr2swBaAI458VANwAoSawjN4Ac3QwAChBao4AXjj1UeRqzgAKAJTaAfIklw4PGMiiM4K8iGAYAdD1QQANgBu6MYA2gC6ppKEUpLoAB6QsHCy8nCQGti4BDoINnAiWQDS6HgAXHAhVOkwqFRhADR5BfgAYozlZpZwSqrqNWaN0dLxifApLCgYahraJuZaVrm29o7OaFiieMbVqJn4plJDQA

Steps to reproduce

  1. Run lint on code snippet
  2. Face @tanstack/query/prefer-query-object-syntax error

Expected behavior

No error should be shown

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

MacOS Ventura

react-query version

^4.14.1

TypeScript version

^4.8.4

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions