Skip to content

[docs] Improve the error message of naming-convention/use-state #980

Closed
@bhollis

Description

@bhollis

Describe the bug

const [{ result, processing }, setState] = useState<ProcessState>({
  processing: false,
  resultStoreId: selectedStore.id,
  result: null,
});

This triggers "An useState call is not destructured into value + setter pair @eslint-react/naming-convention/use-state" but it shouldn't.

Reproduction

const [{ result, processing }, setState] = useState<ProcessState>({
  processing: false,
  resultStoreId: selectedStore.id,
  result: null,
});

Expected behavior

No error.

Platform and versions

Node v23.5.0
ESLint 9.19.0
@eslint-react/react-plugin 1.31.0

Stack trace


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: DocumentationImprovements or additions to documentationType: EnhancementEnhancements to existing features

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions